This is related to my another Issue here: http://drupal.org/node/159093 :
"Some time ago our site got blocked outgoing e-mails (by the webhosting provider, due to spam issues), and so I discovered that Drupal's user and conatct modules are not checking for the return value of mail() function (via user_mail() alias drupal_mail() ) The resulting situation might be almost described as critical, because users were happily registering, but receiving no mails, then sending complaints via site-wide contact form, and no reply. All lost due to mail() failing, and watchdog-logs perfectly clean."
Steps to reproduce:
--- Drupal 5.1 or 4.7.3 (and possibly others?), contact module enabled and working
--- Configure your php or mail software, so that mail() returns FALSE (not sure how exactly, but I'm 100% sure that the return was FALSE in our case)
--- Send a message via some user's Personal contact form, or via Site-wide contact form.
Expected behaviour:
--- Error message to watchdog logs, and to the user.
What happened instead:
--- User got a green message, that e-mail was sent
--- Watchdog got no error/warning entry at all.
Solution proposal:
--- Take the success-check from user.module's request-new-password case, and include similar checks to all the places where e-mails are sent also in contact.module.
--- Alternative: Add error-logging to the drupal_mail() if possible.
Patch:
--- Attaching my patch currently used on live site, but this is badly incomplete, as we're no more using site-wide contact form in original version, so only the Personal forms are addressed by the patch.
--- Needs work.
I'm submitting this almost-duplicate issue to keep track of the problem for both the modules, if maintained separately. If you disagree, feel free to mark one of my issues as Duplicate.
| Comment | File | Size | Author |
|---|---|---|---|
| contact-mail.patch | 1.1 KB | JirkaRybka |
Comments
Comment #1
JirkaRybka commentedMarking this as duplicate - my new 6.x Issue here: http://drupal.org/node/169627