Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Cannot send mail to some email accounts
But why?
Avatar
NFG #1
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
Subject: Cannot send mail to some email accounts
I recently noticed that 5 users on my forum never completed the email validation process.  After emailing them, I found an even stranger problem: the forum simply refuses to send them mail.  I changed their status to MEMBER, it still won't send.  I changed their email to MINE, and it still won't send.

I checked:
Greywall - ignores local (server mail) so not part of the problem.
SMTP AUTH - successfully auth'd (see logs below)
Transaction filters - non triggered, disabled them anyway to no avail
Different email address - still won't send
Other user accounts - send fine
changed user status - still won't send

The UNB error log doesn't help:

06.04.2009 07:20:56 - User 1 NFG - @cp - <IP address>
The message could not be sent.

Backtrace:
* mb/unb_lib/cp.inc.php : 3065 : UnbErrorLog("The message could not be sent.")
* NFGworld/mb/forum.php : 118 : require("E:\data\NFGworld\mb\unb_lib\cp.inc.php")

So I checked the SMTP server logs.  UNB connects, authenticates itself, then QUITs. 

07:20:56.083: >> AUTH CRAM-MD5<cr><lf>
07:20:56.083: << 334 <removed 2 lines of 334 authentication><cr><lf>
07:20:56.083: << 235 Authentication successful.<cr><lf>
07:20:56.083: >> QUIT<cr><lf>

Here's what a successful communication looks like, sent by UNB to a different user:

07:21:11.833: >> AUTH CRAM-MD5<cr><lf>
07:21:11.833: << 334 <removed 2 lines of 334 authentication><cr><lf>
07:21:11.833: << 235 Authentication successful.<cr><lf>
07:21:11.833: >> MAIL FROM:<UNBforum@emailremoved><cr><lf>
07:21:11.833: << 250 Sender OK - send RCPTs.<cr><lf>
07:21:11.833: >> RCPT TO:<UNBuser@emailremoved><cr><lf>
07:21:11.833: << 250 Recipient OK - send RCPT or DATA.<cr><lf>

I'm kind of stumped.  Can anyone offer a clue?
jense #2
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Quote by NFG:
Can anyone offer a clue?
Accidently, I wondered about the same error this morning.  I checked the source and found that for the e-mail form UnbNotifyUser is called in such a way, that the validated e-mail address is used.  Since the corresponding entry is empty, no success is reported and an error message is generated in cp.inc.php.

For now, I think this is a reasonable behavior...
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #3
User title: UNB developer & webmaster
Member since Jan 2004 · 3814 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Yeah, this seems like a dumb change of mine recently. The semantics of the two e-mail fields for each user were changed so that later e-mail address changes could be validated again just like upon registration. Unfortunately the upgrade code didn't seem to work at the first time so the addresses that were already stored were left in an incorrect state. It works for the most cases, but doesn't in some. The reason is that the validated e-mail field still has no or an outdated e-mail address stored. You can correct all e-mail addresses with the following SQL statement, but this will effectively validate all e-mail addresses:

UPDATE ...Users SET ValidatedEMail = EMail;
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #4
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
The reported "error" has nothing to do with the recent changes: it meant users that never ever validated their e-mail address.  For these the current behavior is ok, IMO.
Alala, Alala, Gimme three wishes - CSS
jense #5
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Oh, wait.  I did not check your changes: the optional parameter is new (because undocumented), isn't it?
Alala, Alala, Gimme three wishes - CSS
jense #6
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Thirdly, it should be sufficient to change the error message then to something like: the e-mail cannot be send because there is no validated address yet...
Alala, Alala, Gimme three wishes - CSS
Avatar
NFG #7
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
To be clear, in the error I reported, the email could not be sent DURING VALIDATION.  This user was never activated because his email was never received.
jense #8
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
#10284 :-) - as I wrote: just got exactly the same error...
Alala, Alala, Gimme three wishes - CSS
jense #9
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
And I still do not understand e-mails this week.  Sorry for the noise.

Ok, AFAICT, you have to follow Yves' suggestion in #10283...
Alala, Alala, Gimme three wishes - CSS
Avatar
NFG #10
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
So, if I'm reading this correctly, when UNB attempts to send mail to users who have not had their email addresses validated, it only fails after connecting to the mailserver?

That seems a bit strange to me.  =)
Avatar
Yves (Administrator) #11
User title: UNB developer & webmaster
Member since Jan 2004 · 3814 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Maybe the code connects to SMTP and then checks more details of the message (for multiple users?). It then detects that the message connot be sent because there's no e-mail address.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #12
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Indeed.  AFAICT, this is an optimization for bulk mails, so that the server is only connected once...
Alala, Alala, Gimme three wishes - CSS
Avatar
NFG #13
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
It seems this was never really resolved.  I am still getting users who are never activated 'cause, for reasons unknown, some addresses simply won't go through.  UNB connects, auth's itself, and quits:

EHLO nfgworld.com
AUTH CRAM-MD5
QUIT

If it's connecting first, then checking the validity of the email address, I have to wonder what criteria it's using to fail the address.  It seems to be a perfectly legitimate gmail address, and when I send email to it from my email client (through the same server) it works fine.
Avatar
Yves (Administrator) #14
User title: UNB developer & webmaster
Member since Jan 2004 · 3814 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Here's what it does: Connect to SMTP, then send e-mails one for each user in the same SMTP session, then disconnect. These are the first few lines from the user loop, and the only ones that have the potential to skip the user before any SMTP is sent:

  1. if (!$user->Load($userid)) continue;
  2. $mailAddress = $toUnconfirmedAddress ? $user->GetEMail() : $user->GetValidatedEMail();
  3. if ($mailAddress == '') continue;

Maybe the user doesn't have any e-mail address set in the database? Depending on whether the unconfirmed address shall be used or not, one of both e-mail fields is used. There is not address validity check here.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20110527-dev, © 2003-2011 by Yves Goergen
Page created in 230.2 ms (135 ms) · 126 database queries in 146.8 ms
Current time: 2012-02-07, 20:25:59 (UTC +01:00)