USers tht sign in through drupal.module or other means do not neccessarily have a valid email addrrss stored with Drupal. But they can still subscribe and will fill the mail queue with non-deliverable mail addresses.
The attached patch tries to avoid this, but is completely untested.
Just for the record: drupal.org had 1400 such invalid subscriptions.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | no-invalid-mail_2.patch | 2.19 KB | dww |
| #4 | no-invalid-mail_1.patch | 1.97 KB | hunmonk |
| #2 | no-invalid-mail_0.patch | 1.94 KB | hunmonk |
| no-invalid-mail.patch | 1.27 KB | killes@www.drop.org |
Comments
Comment #1
dwwin principle, this seems good. however, a few issues with this:
global $userinstead of screwing with$GLOBALS['user']directly like this.Comment #2
hunmonk commentedattached gets rid of the ugly globals var, and adds support for anon users.
question: might it be a better idea to simply access control the menu callback so anon can't get to it?
Comment #3
dwwA) url() calls should always be escaped with '@' inside t(), not '!'.
B) We should add a drupal_get_destination() on the url() for anonymous, so that when the login, they get redirected back here.
Comment #4
hunmonk commentedattached should address your concerns.
Comment #5
dwwCool, thanks. Sorry I didn't notice/mention these before, but:
C) Couldn't we include a destination on the url for the profile edit link, so that once they submit the changes on their user account form, they're sent back here?
D) the "register" part of "Please login or register" should be its own separate link (also with the destination). Therefore, you should probably call drupal_get_destination() once and stash that in a variable, which you share among both links, and, depending on if we can get (C) working, there, too...
Thanks!
-Derek
Comment #6
dwwFixed C and D from my previous comment. drupal_get_destination() works great for the link to fix your account. Also, I changed that so it sends you directly to the edit tab, instead of just user/[uid]. As far as I can tell, this is RTBC. Any final objections?
Comment #7
hunmonk commentedcode looks good. fire at will
Comment #8
dwwCommitted to HEAD and installed on d.o. I'm not going to backport this.
Comment #9
aclight commentedI don't have a way to test this, but won't an empty address still be validated by
valid_email_address()? According to http://api.drupal.org/api/function/valid_email_address/5 empty e-mail addresses are valid.Comment #10
hunmonk commentedno, an empty string would fail because it doesn't contain @
Comment #11
(not verified) commented