Page MenuHomePhabricator

Update Mailgun adapter for the new mail adapter API
ClosedPublic

Authored by epriestley on Jan 5 2019, 12:59 PM.
Tags
None
Referenced Files
F15382724: D19959.diff
Fri, Mar 14, 2:07 PM
F15377037: D19959.id47701.diff
Thu, Mar 13, 7:22 AM
Unknown Object (File)
Tue, Feb 25, 8:22 AM
Unknown Object (File)
Tue, Feb 25, 12:00 AM
Unknown Object (File)
Tue, Feb 18, 3:12 PM
Unknown Object (File)
Feb 14 2025, 2:13 AM
Unknown Object (File)
Feb 9 2025, 6:53 AM
Unknown Object (File)
Feb 9 2025, 6:53 AM
Subscribers
None

Details

Summary

Ref T920. Ref T5969. Update the Mailgun adapter for the API changes and add a timeout.

Test Plan

Configured Mailgun as a mailer, sent mail with subject/to/cc/headers/html/attachments using bin/mail send-test.

Diff Detail

Repository
rP Phabricator
Branch
mfa7
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21500
Build 29287: Run Core Tests
Build 29286: arc lint + arc unit

Event Timeline

amckinley added inline comments.
src/applications/metamta/adapter/PhabricatorMailMailgunAdapter.php
43

Shouldn't this be if (strlen($subject))?

77

Unused variable.

86

Another strlen?

91

Another strlen?

This revision is now accepted and ready to land.Jan 10 2019, 4:32 PM
src/applications/metamta/adapter/PhabricatorMailMailgunAdapter.php
43

As currently written, setSubject('') will generate a Subject: header, which seems more faithful to intent than strlen(). I think this is probably moot in practice and (below) sending a mail with (say) an empty-but-present text body is probably weird/a mistake, but it's technically a valid construction. If there's ambiguity in practice, I think it's likely better resolved at a higher level (during message construction, e.g.)

This revision was automatically updated to reflect the committed changes.