When sending mail fails because of invalid address, the mail is not discarded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Richard Mansfield |
Bug Description
If a user registers with an email address like "person@gmail" (invalid domain), the validation doesn't catch that (see bug #731028) but more importantly, the notice below is sent over and over again to the site admin.
We need to make sure that when phpmailer fails for this reason, the email is forever dropped and so only one such notice will be sent to the site admin.
-----Original Message-----
From: Example Site [ mailto:<email address hidden>]
Sent: Tuesday, 8 March 2011 9:25 a.m.
To: Site Admin
Subject: Example Site: User notification error was probably caused by your server configuration.
You have been sent a notification from Example Site. Message follows:
-------
Subject: User notification error was probably caused by your server
configuration.
exception 'EmailException' with message 'Couldn't send email to FirstName LastName
with subject Example Site: New page access. Error from phpmailer was:
You must provide at least one recipient email address.' in
/var/www/
Stack trace:
#0 /var/www/
email_user(
NULL, NULL)
#1 [internal function]: PluginNotificat
Object(stdClass))
#2 /var/www/
call_user_
#3 /var/www/
call_static_
Object(stdClass))
#4 /var/www/
ActivityType-
#5 /var/www/
ActivityType-
#6 /var/www/
handle_
#7 /var/www/
activity_
#8 {main}
-------
This is an auto generated notification from Example Site. To update your
notification preferences, visit
http://
Please do not reply to this message.
Changed in mahara: | |
status: | Confirmed → Fix Committed |
assignee: | nobody → Richard Mansfield (richard-mansfield) |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
I don't think the admin needs to know about attempts to send to invalid email addresses, so I've just thrown a different class of exception in that case and ignored them in notify_user().
It was done like this already with EmailDisabled exceptions, but maybe we should have a think about which exceptions *should* bother the admin, rather than assuming they all should bother the admin by default.