Page MenuHomePhabricator

Improve error and header behaviors for Mailgun received mail webhook

Authored by epriestley on Apr 2 2016, 5:36 PM.
Referenced Files
Unknown Object (File)
Fri, Jul 1, 11:04 PM
Unknown Object (File)
Wed, Jun 29, 2:18 AM
Unknown Object (File)
Sun, Jun 26, 9:33 PM
Unknown Object (File)
Sat, Jun 25, 11:32 AM
Unknown Object (File)
Fri, Jun 17, 11:59 AM
Unknown Object (File)
Wed, Jun 15, 6:00 AM
Unknown Object (File)
Wed, Jun 8, 11:57 PM
Unknown Object (File)
Tue, Jun 7, 2:53 AM



Ref T10709. Two issues:

  • If a user sends an invalid !command, we can throw, which means we don't return HTTP 200. This makes Mailgun re-send the mail later.
  • We don't parse headers of the modern API correctly, so the "Message-ID" failsafe doesn't work. Parse them correctly. I believe Mailgun's API changed at some point.
Test Plan

This is difficult to test exhaustively in isolation. I used Mailgun's web tools to verify the format of the hook request, and faked some requests locally.

I'll keep an eye on this as it goes to production and make sure the fix is correct there.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Improve error and header behaviors for Mailgun received mail webhook.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Apr 2 2016, 5:46 PM
This revision was automatically updated to reflect the committed changes.