Page MenuHomePhabricator

Don't set mail HTML bodies if there's no actual HTML body
ClosedPublic

Authored by epriestley on Jun 15 2018, 7:06 PM.
Tags
None
Referenced Files
F13146792: D19494.diff
Fri, May 3, 10:29 AM
Unknown Object (File)
Thu, Apr 25, 3:54 AM
Unknown Object (File)
Fri, Apr 19, 7:47 PM
Unknown Object (File)
Fri, Apr 5, 5:13 AM
Unknown Object (File)
Mar 31 2024, 11:44 PM
Unknown Object (File)
Mar 31 2024, 11:44 PM
Unknown Object (File)
Mar 31 2024, 11:44 PM
Unknown Object (File)
Mar 31 2024, 11:44 PM
Subscribers
None

Details

Summary

See https://discourse.phabricator-community.org/t/commit-6011085b0fcd-breaks-sending-certain-email/1571. Some mailers get upset if we setHTMLBody(...) with an empty string.

There's some possible argument they should be more graceful about this, but it's reasonably pretty ambiguous.

Only try to set the HTML body if we actually have a nonempty HTML body.

Test Plan
  • Configured an "smtp" mailer.
  • Ran echo hi | ./bin/mail send-test --to someone@somewhere.com --subject test.
  • Before: error about empty message body.
  • After: no more message body error.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable