sendmail authentication failed

rinehart - April 20, 2004 - 19:20

Mail problems seem to be popular now days. I'm configuring 3.2.1 and having problems sending mail from Drupal. Server is SUSE Linux. I've been fumbling around and gotten to the point where Drupal is attempting to send message to the correct mail server, but is not authenticating successfully. The php.ini is configured with the path to sendmail. I've also stored smtp settings in the smtp.php file (including username and password for authentication which has been triple checked). Problem is that Drupal's anonymous user is not using the supplied authentication information.

Our mail server requires authentication on outgoing mail. The reason I know I have the correct mail server is because the mail.info log contains messages indicating "SASL authentication failed; server said: 535 5.7.0 Authentication failed". Our mail server also has several error messages indicating that Authentication failed for the anonymous user trying to send mail. I know this is probably not a Drupal issue, but I really appreciate it if someone with some Linux knowledge could offer insight on this issue.

TIA,

Mac

This might help...

gundee - April 20, 2004 - 20:26

I'm no Drupal guru, but see this thread.

http://drupal.org/node/view/7232

The smtp.inc worked for me. Piece of cake.

been there, done that...

rinehart - April 20, 2004 - 21:14

Thx,

I saw your thread and gave it a shot. Still doesn't work and getting the same error message.

does sendmail require authentication?

rinehart - April 20, 2004 - 22:35

gundee,

Does your smtp server require authentication for outgoing mail? Mine does. I've reviewed these two .inc files and it appears that I should be getting an error in my watchdog if authentication fails. I'm finding that according to drupal the mail is being sent successfully, but according to my mail server there is no username or password supplied with the attempt to send a message. This should generate an error which is subsequently logged back to drupal but that's not happening. I don't understand why.

I'd love to hear from someone who has authentication required for message delivery on what the issue might be. Thanks,

Mac

includes/smtp.inc doesn't exist

rinehart - April 21, 2004 - 00:03

Further travels. When I fisrt used smtp.inc I got the following error message:

warning: user_mail(includes/smtp.inc) [function.user-mail]: failed to create stream: No such file or directory in /srv/www/htdocs/drupal-4.3.2/modules/user.module on line 301.

I thought this indicated that 'includes/smtp.inc' was an invalid path, but this is not the case. in fact the file_exists function successfully finds the smtp.inc file on this path, and the include_once function is invoked (whether successful or not I do not know.). But when the line :

return user_mail_wrapper($mail, $subject, $message, $header);

is invoked the error occurs with a second message indicating that the function user_mail_wrapper does not exist. Of course, the function is clearly defined in the smtp.inc file, and gundee reports it works fine for him. Anyone seen this before?

- Mac

You really should read the RE

killes@www.drop.org - April 21, 2004 - 00:20

You really should read the README. There is a reason it was named that way...

And the answer is...

rinehart - April 21, 2004 - 00:43

Ok, I think there is an issue with the user.module - I've found a solution to this problem but it's a kludge. The php function file_exists('includes/smtp.inc') looks for the file relative to the current working directory and finds it. However, the function include_once looks for a file relative to the calling program. Consequently file_exists is looking in the path:

/srv/www/htdocs/drupal-4.3.2/includes/smtp.inc

but include_once is looking for the same variable in:

/srv/www/htdocs/drupal-4.3.2/<b>modules/</b>includes/smpt.inc

The solution to this problem was to create a dynamic link from modules/includes to includes

So, after fixing all of that, smtp.inc appears to be working, but I am still unable to send mail. For an error message I get the following:

mail send error: AUTH command failed: Error: authentication not enabled

Any additional help is greatly appreciated. :)

-- Mac

AUTH LOGIN not implemented

rinehart - April 21, 2004 - 17:45

Just documenting my findings for the good of the order. After putting some debug messages into the auth() function for class.smpt.inc I found that the mail server was sending a 504 response code to the 'AUTH LOGIN' command. According to the spec for the SMTP response codes this code indicates that the command is not implemented. Consequently, it appears that my issue is with the mail server, and not with Drupal.

- Mac

Another SMTP Trick

rinehart - April 21, 2004 - 22:16

After failing to get the "SMTP Trick" to work, I created a new smtp_library that uses phpmailer. The new library works great, so mail is now functioning. I'm not sure if this is generally true but the existing solution didn't seem to work when authentication with the mail server is required to send mail.

If you're interested in the solution I've submitted it as an enhancement. It's available at:

http://drupal.org/node/view/7294

 
 

Drupal is a registered trademark of Dries Buytaert.