Page MenuHomePhabricator

Error handling for mail send-test needs improvement
Closed, WontfixPublic

Description

I'm trying to debug an Amazon SES integration issue where for some reason, even though my entire domain is verified I cannot send or receive email. I was trying to use mail send-test to debug this, but all I get is

ubuntu@ip-172-31-8-118:/opt/phabricator$ bin/mail send-test --to anton --subject hello < README.md
Reading message body from stdin...
[2016-02-18 08:41:23] EXCEPTION: (SimpleEmailServiceException) SimpleEmailService::sendRawEmail(): Sender - MessageRejected: Email address is not verified.
Request Id: 63a1b074-d61b-11e5-9cf3-419821317f77
 at [<phabricator>/externals/amazon-ses/ses.php:390]
arcanist(head=master, ref.master=fcc11b3a2781), phabricator(head=master, ref.master=e4690a385447), phutil(head=master, ref.master=f43291e99d36)
  #0 SimpleEmailService::__triggerError(string, array) called at [<phabricator>/externals/amazon-ses/ses.php:272]
  #1 SimpleEmailService::sendRawEmail(string) called at [<phabricator>/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php:33]
  #2 PhabricatorMailImplementationAmazonSESAdapter::executeSend(string) called at [<phabricator>/externals/phpmailer/class.phpmailer-lite.php:496]
  #3 PHPMailerLite::Send() called at [<phabricator>/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php:104]
  #4 PhabricatorMailImplementationPHPMailerLiteAdapter::send() called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:733]
  #5 PhabricatorMetaMTAMail::sendNow() called at [<phabricator>/src/applications/metamta/PhabricatorMetaMTAWorker.php:26]
  #6 PhabricatorMetaMTAWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:122]
  #7 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:161]
  #8 PhabricatorWorker::scheduleTask(string, integer, array) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:405]
  #9 PhabricatorMetaMTAMail::save() called at [<phabricator>/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php:157]
  #10 PhabricatorMailManagementSendTestWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:408]
  #11 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #12 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/mail/manage_mail.php:21]
PHP Fatal error:  Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /opt/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}
  thrown in /opt/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Fatal error: Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /opt/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}
  thrown in /opt/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Given that this is a testing facility, it at the very least provide more information on the system actually generated and attempted to send. Without this data I'm pretty much left guessing which address got rejected and why.

Event Timeline

epriestley claimed this task.
epriestley added a subscriber: epriestley.

We haven't seen other users encounter difficulty with this, and the error message is relatively specific already.

You can use bin/mail list-outbound and bin/mail show-outbound to get more details about the mail.