PDA

View Full Version : Authentication in UE


Stan
05-16-2009, 10:34 AM
I'm baffled. I'm assuming that UE will use any smtp server? But 99% of smtp servers now require authentication. But I can't find any place in UE to do the authentication. I can't find any mention of it in the documentation. I can't find any questions on the forum mentioning it. Am I way off base here? Do I not understand how UE works?

OK....more research NOT on the webassist.com. I need to use PEAR for authentication with PHP on SMTP. So why isn't this documented anywhere? It appears that the "powerstore" solution doesn't use PEAR? Why would that be when 99% are going to need that solution? Go figure.

Ray Borduin
05-18-2009, 06:56 AM
99% of web servers using php actually don't require authentication. In fact I haven't run into a popular hosting company that does. Where do you host?

Usually they will set up php with a default smtp server and use IP restrictions to allow requests from the web server so no additional security is required.

Stan
05-18-2009, 08:50 AM
Ray, you're a pretty sharp cookie. lol. I'm using ucvhost.com because they are cheap. Their equipment is in Bombay as is their support which can be EXTREMELY frustrating. I have found out that the mail server is hosted on another server and no they didn't set it up with ip restrictions to allow the mail transport to access it. I'm going to go into a little detail here that I know that you know but anyone else who doesn't won't have to research all of this.

Hosting companies typically require authentication for smtp server from outside clients because of the proliferation of spam. However in the case of a web application which is running on the same server or server farm as the smtp server the authentication is usually not required.

Php doesn't provide native authentication. It uses the mail() function with up to 5 arguments. The mail server isn't defined in the arguments. It is defined in the php.ini which is located on the hosting server and probably isn't available for edit. In my case php.ini defined smtp=localhost which of course wasn't the location of the server so it failed. And actually for clarity the mail() function just passes the mail to the Mail Transfer Agent (MTA) which in turn communicates with the mail server.

The solution for me it appears would be one of three.
1. Pick a different host.
2. Convice ucvhost to properly set up the mail server as Ray suggested.
3. Use a different vehicle such as PEAR which is supported by universal email but requires that the host has installed the PEAR package.

Ray can you tell me what the "path to PEAR" parameter in UE should look like? Is this PEAR at localhost or should it be PEAR on the mail server? URL ok or does it need IP? or maybe localhost? Thanks for your help!

Ray Borduin
05-18-2009, 09:49 AM
It is the location of the mail.php file that is installed with PEAR. In most cases it can be blank because when Pear is installed properly it can almost always be blank... 99% of the time blank but who knows with your host ;)

Steve272190
06-08-2009, 06:58 AM
It is the location of the mail.php file that is installed with PEAR. In most cases it can be blank because when Pear is installed properly it can almost always be blank... 99% of the time blank but who knows with your host ;)


I just installed PEAR (PEAR-1.8.1) and there is no "mail.php" file anywhere in this latest install. Does this now mean recoding the WA extension to use pear.php or pear5.php?

Ray Borduin
06-08-2009, 07:16 AM
Just leave that field blank and see what happens. Do you get an error? What is the error?

Steve272190
06-08-2009, 08:34 AM
Just leave that field blank and see what happens. Do you get an error? What is the error?

Same error without the path defined in UE regarding the path to PEAR:

""


Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in E:\*****\WA_Universal_Email\PEAR_Mail_using_SMTP_P HP.php on line 115

Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.;d:\php\includes;D:\PHP\PEAR') in E:\****\WA_Universal_Email\PEAR_Mail_using_SMTP_PH P.php on line 115


""

Note, that UE is looking for the referenced mail.php, which does not exist in pear

Ray Borduin
06-08-2009, 08:40 AM
Most samples I see still reference the need for that file for pear to work:

http://email.about.com/od/emailprogrammingtips/qt/et073006.htm

Usually pear does have a file named mail.php. Your version must use another definition file. Are you sure pear was installed properly? what happens when you remove the line of code causing errors?

Steve272190
06-08-2009, 11:12 AM
Turns out Mail is a separate module install for PEAR, This as well as the smtp NET modules have been installed and now there is a mail.php file. But the next expectation from UE is :

Fatal error: require_once() [function.require]: Failed opening required 'D:\php\pearMail.php' (include_path='.;d:\php\PEAR') in
\WA_Universal_Email\PEAR_Mail_using_SMTP_PHP.php on line 115


good ol pearMail.php.... Not installed in the latest module installs.

List of successful PEAR modules that are installed:

INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE VERSION STATE
Archive_Tar 1.3.2 stable
Console_Getopt 1.2.3 stable
Mail 1.1.14 stable
Net_SMTP 1.3.2 stable
Net_Socket 1.0.9 stable
PEAR 1.7.2 stable
Structures_Graph 1.0.2 stable


Also installed the latest version of PHP just for fun 5.2.9 on Windows server 2003

So everyone else has this pearMail.php file?

Ray Borduin
06-08-2009, 11:50 AM
The file should be called mail.php.... What did you put as your pear path? Looks like it could be missing the trailing slash?

Steve272190
06-08-2009, 12:00 PM
The file should be called mail.php.... What did you put as your pear path? Looks like it could be missing the trailing slash?

Ahh so you are saying that pearMail.php is a concatenation of the string...

Yes you are right I needed to add a double trailing slash in WAUE_MassMail_tpl_1.php
:

$WA_MailObject = WAUE_Definition("D:\\php\\pear\\",..........

That work in removing the error. Thanks for the info.