Mail debugging script does not display actual error message


#1

I am trying to configure outbound email using SES. Which is failing for some reason.

I can successfully send a test mail with

AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws ses send-email --from <metamta.default-address> --destination file:///tmp/destination.json --message file:///tmp/message.json --region us-east-1

But I cannot send test email with bin/mail.

bin/mail send-test --to joyce --subject hello < /tmp/message.txt 

is failing with the following exception, which does not include the actual error message from SES.

Reading message body from stdinā€¦

[2018-11-07 20:35:03] EXCEPTION: (SimpleEmailServiceException) Unexpected HTTP status while making request to Amazon SES: expected 200, got 400. at [<phabricator>/externals/amazon-ses/ses.php:509]

arcanist(head=master, ref.master=a60454810102), phabricator(head=master, ref.master=ee32c186dd82), phutil(head=master, ref.master=20eff1c8d14f)

#0 SimpleEmailServiceRequest::getResponse() called at [<phabricator>/externals/amazon-ses/ses.php:253]

#1 SimpleEmailService::sendRawEmail(string) called at [<phabricator>/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php:65]

#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:126]

#4 PhabricatorMailImplementationPHPMailerLiteAdapter::send() called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:605]

#5 PhabricatorMetaMTAMail::sendWithMailers(array) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:491]

#6 PhabricatorMetaMTAMail::sendNow() called at [<phabricator>/src/applications/metamta/PhabricatorMetaMTAWorker.php:22]

#7 PhabricatorMetaMTAWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:123]

#8 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:162]

#9 PhabricatorWorker::scheduleTask(string, integer, array) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:468]

#10 PhabricatorMetaMTAMail::save() called at [<phabricator>/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php:193]

#11 PhabricatorMailManagementSendTestWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:441]

#12 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:333]

#13 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/mail/manage_mail.php:21]


#2

You can try to apply https://secure.phabricator.com/D18283 locally, which will give you the error message.


#3

Thank you. I found the original error message from SES by prepending $this->response->body to the SimpleEmailServiceException message.