1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00
Commit graph

8 commits

Author SHA1 Message Date
epriestley
ee814923a2 Improve Amazon SES code error handling behavior
Summary:
Fixes T10728. Fixes T10476. SES uses third-party code with unique, creative ideas about error handling.

  - Make the error handling behavior more correct, so it doesn't try to use undefined variables.
  - Simplify the error handling behavior (throw exceptions sooner, remove redundant code).
  - Explicitly test for `-smtp` misconfigurations. These can arise if you read the wrong column out of the table in the AWS docs, as in T10728.
  - Explicitly test for SimpleXML, to catch T10476 before it does damage.

Test Plan:
  - Configured SES to use a bogus SMTP endpoint.
  - Faked past the SMTP check, hit sane error on the connection.
  - Undid faking, hit immediate hard stop on the STMP check.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10476, T10728

Differential Revision: https://secure.phabricator.com/D15632
2016-04-05 17:28:45 -07:00
epriestley
c29bbbab19 Remove bogus '$this->resource' from SES error handling pathway
Summary: Ref T10728. This property does not exist and is never referenced. The `'resource'` key is also never referenced, so I believe this can be safely removed.

Test Plan: Will make @amckinley do my job for me.

Reviewers: chad

Reviewed By: chad

Subscribers: amckinley

Maniphest Tasks: T10728

Differential Revision: https://secure.phabricator.com/D15624
2016-04-05 13:19:07 -07:00
Brooke Bryan
8af2f0d755 Fix undefined property in Amazon SES
Summary:
When sending an email through ses, the body property on the response object is not set, throwing a notice.  This causes the system to assume a messsage failure, and requeues the email.

As the email is actually delivered, it causes an email bomb :(

Message Undefined property: stdClass::$body
#0 /sidekick/phabricator/phabricator/externals/amazon-ses/ses.php(571): PhutilErrorHandler::handleError(8, 'Undefined prope...', '/sidekick/phabr...', 571, Array)
#1 [internal function]: SimpleEmailServiceRequest->__responseWriteCallback(Resource id #290, '<SendRawEmailRe...')
#2 /sidekick/phabricator/phabricator/externals/amazon-ses/ses.php(526): curl_exec(Resource id #290)
#3 /sidekick/phabricator/phabricator/externals/amazon-ses/ses.php(267): SimpleEmailServiceRequest->getResponse()
#4 /sidekick/phabricator/phabricator/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php(33): SimpleEmailService->sendRawEmail('To: brooke.brya...')
#5 /sidekick/phabricator/phabricator/externals/phpmailer/class.phpmailer-lite.php(502): PhabricatorMailImplementationAmazonSESAdapter->executeSend('To: brooke.brya...')
#6 /sidekick/phabricator/phabricator/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php(91): PHPMailerLite->Send()
#7 /sidekick/phabricator/phabricator/src/applications/metamta/storage/PhabricatorMetaMTAMail.php(631): PhabricatorMailImplementationPHPMailerLiteAdapter->send()
#8 /sidekick/phabricator/phabricator/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php(130): PhabricatorMetaMTAMail->sendNow()
#9 /sidekick/phabricator/libphutil/src/parser/argument/PhutilArgumentParser.php(396): PhabricatorMailManagementSendTestWorkflow->execute(Object(PhutilArgumentParser))
#10 /sidekick/phabricator/libphutil/src/parser/argument/PhutilArgumentParser.php(292): PhutilArgumentParser->parseWorkflowsFull(Array)
#11 /sidekick/phabricator/phabricator/scripts/mail/manage_mail.php(28): PhutilArgumentParser->parseWorkflows(Array)
#12 {main}

Test Plan: Send a test email through SES mail provider running on php 5.5

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran, btrahan

Differential Revision: https://secure.phabricator.com/D7660
2013-11-26 12:52:38 -08:00
epriestley
1e6deff8ba Don't use deprected "1" value to cURL CURLOPT_SSL_VERIFYHOST
Summary: Fixes T2962. That task discusses this issue.

Test Plan: Read php-curl documentation to verify this change makes sense. Sent an email with SES.

Reviewers: btrahan, garoevans

Reviewed By: garoevans

CC: aran

Maniphest Tasks: T2962

Differential Revision: https://secure.phabricator.com/D5669
2013-04-12 08:10:22 -07:00
epriestley
d064c6efa8 Use exceptions for S3 error messages
Summary:
Right now, the "SimpleEmailService" class uses trigger_error() to communicate
error messages. This means they get lost in the error logs and aren't visible in
the MetaMTA interface.

Provide a flag to strengthen them into exceptions, instead.

(I've attempted to emulate the prevailing style so I can offer this upstream.)

Test Plan: Faked an error condition and got a detailed stack trace in MetaMTA
instead of an empty "Message" field.
Reviewed By: jungejason
Reviewers: hunterbridges, codeblock, jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 783
2011-08-04 14:17:13 -07:00
epriestley
8347729fc0 When sending with Amazon SES, use the AWS sendRawEmail API instead of sendEmail,
so we can send custom headers.

Summary:

Test Plan:

Reviewers:

CC:
2011-02-09 16:05:06 -08:00
epriestley
ed5cddf8d7 Convert SES from tabs to spaces
Summary:

Test Plan:

Reviewers:

CC:
2011-02-09 16:04:14 -08:00
epriestley
8098954776 Add basic Amazon SES support.
Summary:

Test Plan:

Reviewers:

CC:
2011-02-07 21:08:32 -08:00