Page MenuHomePhabricator

Improve error and header behaviors for Mailgun received mail webhook
ClosedPublic

Authored by epriestley on Apr 2 2016, 5:36 PM.
Tags
None
Referenced Files
F13091410: D15575.diff
Thu, Apr 25, 2:55 AM
Unknown Object (File)
Fri, Apr 19, 4:22 PM
Unknown Object (File)
Wed, Apr 17, 3:21 PM
Unknown Object (File)
Thu, Apr 11, 10:14 AM
Unknown Object (File)
Mon, Apr 1, 8:05 PM
Unknown Object (File)
Sat, Mar 30, 4:21 PM
Unknown Object (File)
Mar 21 2024, 12:58 PM
Unknown Object (File)
Feb 24 2024, 9:15 AM
Subscribers
None

Details

Summary

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

Repository
rP Phabricator
Branch
mail1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11413
Build 14222: Run Core Tests
Build 14221: arc lint + arc unit

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.