Closed (cannot reproduce)
Project:
Drupal core
Version:
6.x-dev
Component:
user.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2005 at 18:12 UTC
Updated:
27 Dec 2011 at 18:55 UTC
The user module has error handling for failed emails sent on password changing, but not yet in other cases, so that users may register and get a message that email has been sent when in fact it has not, an issue reported, e.g., here. This patch adds tests for mails sent on user registration, generating appropriate user feedback (e.g., "Unable to send mail", etc.) and logs errors to the watchdog.
| Comment | File | Size | Author |
|---|---|---|---|
| user-mail-error-messages.patch | 7.2 KB | nedjo |
Comments
Comment #1
killes@www.drop.org commentedLooks goog, +1. I also consider the lack of tests a bug.
Comment #2
dries commentedMaybe we can extend user_mail() to log failed mail() attempts? Like that, all such instances would automatically get logged.
Comment #3
killes@www.drop.org commenteduser_mail() has no idea of the context in which it is called. So error messages would be vague at best. I think the patch should go in as it is.
Comment #4
nedjoThere are (at least) four types of actions we sometimes want on mail attempts: logging (both success and failure) and a user response message (again, both success and failure). So, even if user_mail() handled logging (e.g., through two additional optional arguments passed in, success and failure messages), we would still have to test for success or failure of the call to know what message to return to the user.
Or else pass in four arguments, with the user message (success or failure) returned. But that seems awkward at best, and also defeats the desirable practice of returning false on failure.
Anyone see an elegant way to handle this programatically? If not, handling each call separately as I've done is probably the way to go.
Comment #5
samo commentedI don't know if this is relevant...
Modules like subscriptions, emailpage, and og all send emails out to users. With a large enough userbase, I can imagine a scenario where you would want to disable emails being sent out to a user after a certain bounce/failure limit is hit (like Mailman does). Logging a failure inside "user_mail" makes sense to me, but I am curious to hear if this is an issue for others.
I see a separate table for bounced/failed emails (time, uid) and then a cron job to disable sending emails to a user after the bounce limit is hit.
Comment #6
nedjoNot sure why this was reset to active. Logging is, I believe, a distinct issue. The problems addressed by this patch are (a) drupal claims mail has been sent when in fact it has not, (b) there is no way to recover a password sent out in a failed email.
Comment #7
killes@www.drop.org commentedOne hunk fails. I still consider this issue to be important to fix.
Comment #8
Jaza commentedI too consider both the lack of error-checking and the lack of error-reporting to be a bug, and one that still needs fixing. Moving to 6.x queue.
Comment #9
panchoObviously still to be fixed. Critical IMHO.
Comment #10
dpearcefl commentedIs this still an issue in current D6?
Comment #11
aspilicious commentedA few years without any response. Feel free te reopen if needed.