e-mail notifications for new users

Posts: 70
Joined: 04/14/2008

My site seems to have developed a hiccup. When new users create a new account, they should receive an email containing their site password. Although the notification e-mails are being reported as sent in the site log, they aren't getting through to the users. I've tried creating a few boilerplate accounts, and they are indeed not getting through. I've checked the spam filters on all the accounts -- no joy. Any suggestions on how I might troubleshoot this issue? (Notify module is enabled). Perhaps I'm missing something in my php config?

Posts: 2244
Joined: 08/07/2007
AdministratoreLiTe!

Drupal says the mails are sent, but does the actual mailing software say it's going? Somewhere on the server there should be some kind of mail log, and that might hold more clues. Also, investigate your firewall settings. For certain situations, I wouldn't be surprised to learn that somebody is trying to prevent spam from the source, but being a little overzealous about it.

Posts: 70
Joined: 04/14/2008

I suspected the same, but haven't seen anything in the error logs about it. I'll check the firewall as well, and perhaps get my hosting provider involved to track down the issue. I'll post what I can find. ?What does drupal use for sending e-mail?

Posts: 2244
Joined: 08/07/2007
AdministratoreLiTe!

Ultimately, PHP's mail() function. I'm sure there's a lot of settings that affect how it works.

Posts: 70
Joined: 04/14/2008

Just to see what might be going on behind the curtain on my server, I tried a simple test script to send an e-mail using php's mail() function. No problems. My hosting provide isn't being very helpful, as they see this is a problem with "an unsupported install of drupal", and not something potentially wrong with anything on their end (seeing as how my test script worked, I can't say I blame them). I'm hosting on a grid server, so I don't have access to the equivalent of a syslog to help diagnose what's going on. Drupal is perfectly happy, thinking its firing off e-mails without issue.

Drupal docs seemed to indicate that mail sending is executed by the drupal_mail_send function. I'll dig into my drupal install and see what I can turn up.

Posts: 70
Joined: 04/14/2008

Nevermind -- drupal_mail_send is a drupal 6 function. Didn't pick that up on the first read. drupal_mail is the function used, and it's defined in common.inc. Don't know what the issue might be. It's obviously getting called, and mail() works, so I don't know where to look next.

Posts: 70
Joined: 04/14/2008

I found the issue -- seems the culprit was smtp_library. Commenting out the custom backend portion of drupal_mail in common.inc fixed the problem (lines 1959-1962). Thanks for all the help. This community is very courteous and helpful.

Posts: 2244
Joined: 08/07/2007
AdministratoreLiTe!

Oh, interesting. One of your modules must have set the smtp_library variable to something broken. The only suspect I have is devel module, but it could possibly be something else. Grep your installation for "smtp_library" if you can, or if you remember a setting dealing with the mail handlers, setting it back to "" would be a better fix than hacking Drupal. Even if you can't find it in the code, you can still remove the row from the {variable} table.

Posts: 70
Joined: 04/14/2008

I do have devel installed, but not enabled at the moment. You're probably right in suspecting devel.module. I didn't set anything with regards to mail handling in my install apart from the site reply to address (which seems to be working fine, btw). I'll poke around and see if I can figure out what's going on. Good idea on removing smtp_library form the variable table if I can't, however.

That leads me to a slightly related question -- I enabled thickbox logins, disabled the login block, and added the "create a new account" and "request new password" list items to the user_login function in user.module. Since user.module is a core module, I imagine this is a no-no, even though it shouldn't cause any issues with a cvs sync (at least, I think it won't?). I assume I can do the same by defining a new function "theme_user_login" in template.php? Would that be a more drupal way of doing things?

Sorry for the ROE violation -- should probably start a new thread for this one.

Posts: 70
Joined: 04/14/2008

Lyle -- you were right. It appears that smtp_library was set via the devel module (that's the only module that references it in my install, apart from drupal_mail in common.inc). Since I'm not using the devel module currently, I'll remove smtp_library from the variables table and see what happens. Thanks for the rudder on this issue.