Page MenuHomePhabricator

PHPMailer email verification incorrect
Closed, ResolvedPublic

Description

I realized the problem when getting reports that phab didn't send emails. Looking in the logs, I was seeing:
[30-May-2014 10:33:48 UTC] [2014-05-30 10:33:48] EXCEPTION: (PhutilProxyException) Error while executing task ID 316199 from queue. {>} (phpmailerException) Invalid address: Manuel Klimek <klimek@google.com> at [/srv/http/phabricator/externals/phpmailer/class.phpmailer.php:462]
[30-May-2014 10:33:48 UTC] #0 PHPMailer::AddAnAddress(to, Manuel Klimek <klimek@google.com>, ) called at [/srv/http/phabricator/externals/phpmailer/class.phpmailer.php:408]
[30-May-2014 10:33:48 UTC] #1 PHPMailer::AddAddress(Manuel Klimek <klimek@google.com>) called at [/srv/http/phabricator/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php:64]
[30-May-2014 10:33:48 UTC] #2 PhabricatorMailImplementationPHPMailerAdapter::addTos(Array { 0 => Manuel Klimek <klimek@google.com> }) called at [/srv/http/phabricator/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:611]
[30-May-2014 10:33:48 UTC] #3 PhabricatorMetaMTAMail::sendNow() called at [/srv/http/phabricator/src/applications/metamta/PhabricatorMetaMTAWorker.php:26]
[30-May-2014 10:33:48 UTC] #4 PhabricatorMetaMTAWorker::doWork() called at [/srv/http/phabricator/src/infrastructure/daemon/workers/PhabricatorWorker.php:85]
[30-May-2014 10:33:48 UTC] #5 PhabricatorWorker::executeTask() called at [/srv/http/phabricator/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:123]
[30-May-2014 10:33:48 UTC] #6 PhabricatorWorkerActiveTask::executeTask() called at [/srv/http/phabricator/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
[30-May-2014 10:33:48 UTC] #7 PhabricatorTaskmasterDaemon::run() called at [/srv/http/libphutil/src/daemon/PhutilDaemon.php:85]
[30-May-2014 10:33:48 UTC] #8 PhutilDaemon::execute() called at [/srv/http/libphutil/scripts/daemon/exec/exec_daemon.php:112]

I haven't had time to fully look into the problem yet, but it looks like ValidateAddress started to go into the branch where it uses php's filter_var function, and that rejects the normal looking email addresses.
I quick-fixed it by making all exits from that function return true, and things seem back to normal.

Event Timeline

klimek raised the priority of this task from to Needs Triage.
klimek updated the task description. (Show Details)
klimek added a subscriber: klimek.

Hi,

facing same problem,

[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] [2014-07-20 17:31:52] EXCEPTION: (PhutilProxyException) Error while executing task ID 304 from queue. {>} (phpmailerException) Invalid
address: Charlie Root <root@vp1.XXXX> at [<phabricator>/externals/phpmailer/class.phpmailer-lite.php:381]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #0 PHPMailerLite::AddAnAddress(string, string, string) called at [<phabricator>/externals/phpmailer/class.phpmailer-lite.php:327]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #1 PHPMailerLite::AddAddress(string) called at [<phabricator>/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailer
LiteAdapter.php:41]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #2 PhabricatorMailImplementationPHPMailerLiteAdapter::addTos(array) called at [<phabricator>/src/applications/metamta/storage/Phabric
atorMetaMTAMail.php:611]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #3 PhabricatorMetaMTAMail::sendNow() called at [<phabricator>/src/applications/metamta/PhabricatorMetaMTAWorker.php:26]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #4 PhabricatorMetaMTAWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:87]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #5 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.ph
p:124]
[20-Jul-2014 17:31:52 Asia/Kuala_Lumpur] #6 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.
php:19]

We're seeing this on this install now too:

[2014-07-31 20:49:41] EXCEPTION: (PhutilProxyException) Error while executing task ID 520997 from queue. {>} (phpmailerException) Invalid address: "DATA SCRUBBED" at [<phabricator>/externals/phpmailer/class.phpmailer-lite.php:381]
#0 PHPMailerLite::AddAnAddress(string, string, string) called at [<phabricator>/externals/phpmailer/class.phpmailer-lite.php:327]
#1 PHPMailerLite::AddAddress(string) called at [<phabricator>/src/applications/metamta//PhabricatorMailImplementationPHPMailerLiteAdapter.php:41]
#2 PhabricatorMailImplementationPHPMailerLiteAdapter::addTos(array) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:611]
#3 PhabricatorMetaMTAMail::sendNow() called at [<phabricator>/src/applications/metamta/PhabricatorMetaMTAWorker.php:26]
#4 PhabricatorMetaMTAWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:87]
#5 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:124]
#6 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
#7 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:84]
#8 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]