Page MenuHomePhabricator

Allow mailers to be explicitly marked as inbound or outbound
ClosedPublic

Authored by epriestley on Jul 27 2018, 9:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 1:28 AM
Unknown Object (File)
Tue, Nov 26, 10:54 AM
Unknown Object (File)
Sun, Nov 24, 8:53 PM
Unknown Object (File)
Nov 19 2024, 6:06 PM
Unknown Object (File)
Nov 16 2024, 7:12 AM
Unknown Object (File)
Nov 12 2024, 10:31 AM
Unknown Object (File)
Nov 9 2024, 4:30 PM
Unknown Object (File)
Nov 8 2024, 4:03 PM
Subscribers
None

Details

Summary

See PHI785. Ref T13164. In this case, an install wants to receive mail via Mailgun, but not configure it (DKIM + SPF) for outbound mail.

Allow individual mailers to be marked as not supporting inbound or outbound mail.

Test Plan
  • Added and ran unit tests.
  • Went through some mail pathways locally, but I don't have every inbound/outbound configured so this isn't totally conclusive.
  • Hit bin/mail send-test with a no-outbound mailer.
  • I'll hold this until after the release cut so it can soak on secure for a bit.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

What happens to an install that incorrectly configures these settings (all inbound disabled, all outbound disabled, etc)? Is it worth validating cluster.mailers and raising a setup issue?

What happens when you accidentally configure an inbound-only mailer as outbound (or the other way around, which might fail even more quietly)? I guess the logs/errors wouldn't be any harder to get to, and the debug process would be the same, so this probably isn't a big issue.

This revision is now accepted and ready to land.Jul 29 2018, 4:15 PM

I'm tentatively thinking it's "legal" to configure this correctly and disable all mailers of one or both types explicitly, under the theory that this is sufficiently far out of the way that it's more likely you did it on purpose (e.g., you want to stop inbound or outbound mail while you fix or investigate something) than made a mistake. So I'm hesitant to raise a setup warning, since it feels like this is an OK configuration that you can legitimately end up in.

The inbound mailers are all configured individually anyway so you don't get any new/additional behavior by disabling all of them versus disabling only some of them.

For outbound, we'll currently void the mail with this message:

No mailers are configured.

Admittedly, that's not great for the "mailers are configured but none support outbound" state of the world. I'll special case that into "no mailers" and "no outbound mailers" messages just in case someone hits this.

  • Tailor the error message for voided sends with no available outbound mailers.

This is a little finnicky because you can pass some custom list of $mailers to confuse things, but in actual cases which normal users will ever hit this should get things right and produce a more helpful message.

This revision was automatically updated to reflect the committed changes.