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.

Comments

dww’s picture

Status: Needs review » Needs work

in principle, this seems good. however, a few issues with this:

  • shouldn't we gracefully handle anonymous users here with a "Please [login] or [register] to subscribe to issues" sort of thing?
  • if we're changing this code, i'd rather see global $user instead of screwing with $GLOBALS['user'] directly like this.
hunmonk’s picture

Status: Needs work » Needs review
StatusFileSize
new1.94 KB

attached 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?

dww’s picture

Status: Needs review » Needs work

A) 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.

hunmonk’s picture

Status: Needs work » Needs review
StatusFileSize
new1.97 KB

attached should address your concerns.

dww’s picture

Status: Needs review » Needs work

Cool, 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

dww’s picture

Assigned: killes@www.drop.org » dww
Status: Needs work » Needs review
StatusFileSize
new2.19 KB

Fixed 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?

hunmonk’s picture

Status: Needs review » Reviewed & tested by the community

code looks good. fire at will

dww’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD and installed on d.o. I'm not going to backport this.

aclight’s picture

I 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.

hunmonk’s picture

no, an empty string would fail because it doesn't contain @

Anonymous’s picture

Status: Fixed » Closed (fixed)