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
F19789048: D19494.diff
Wed, Feb 25, 4:59 PM
F18814891: D19494.id.diff
Oct 21 2025, 12:04 AM
F18808261: D19494.diff
Oct 19 2025, 5:49 AM
F18761573: D19494.id46619.diff
Oct 6 2025, 3:11 PM
F18656629: D19494.diff
Sep 22 2025, 11:01 PM
F18652468: D19494.id46618.diff
Sep 21 2025, 8:09 AM
F18625100: D19494.id.diff
Sep 15 2025, 9:58 PM
F18509674: D19494.id.diff
Sep 5 2025, 3:32 AM
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
Branch
html1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20423
Build 27736: Run Core Tests
Build 27735: arc lint + arc unit