Page MenuHomePhabricator

Phabricator email aren't HTML valid / properly formatted
Closed, InvalidPublic



I am not sure if this is intended behavior but I noticed that Phabricator emails are not properly formatted - they aren't HTML valid and lack the plain text alternative part.

One example of such email message

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<td style="">bbrdaric-test added a project: Some project.
<div><strong>TASK DETAIL</strong>
<div><a href="https://phabricator.local/T123" rel="noreferrer">https://phabricator.local/T123</a>
<div><strong>EMAIL PREFERENCES</strong>
<div><a href="https://phabricator.local/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.local/settings/panel/emailpreferences/</a>
<div><strong>To: </strong>bbrdaric-test

Because of this, they run into our SpamAssassin Rules and eventually get marked as spam.

X-Spam-Checker-Version: SpamAssassin
X-Spam-Level: ******
X-Spam-Status: No, score=6.3 required=10.0 tests=ALL_TRUSTED,BAYES_99,

I tried to find config option for sending plain-text emails, but as I can see, Phabricator supports sending only HTML emails?

Version Information

phabricator 8cb3706fe80fdd0fa416c114eda9363c7226c315 (Tue, Apr 25) (branched from 03d0e3fdbc890ca9670e8caaf20aa39ebd61d04b on origin)
arcanist 146693307f607ffa93dfb99599f1989d5b27e03d (Fri, Apr 21)
phutil 6fe33623cda69b7814a0767866400e09f4eadf3a (Thu, Apr 13)

Event Timeline

Which version of phabricator are you running? Email I get have a plain-text alternate, have no meta tag, and are formatted very differently.

not having <HTML> sounds both easy to fix, and a very nitpicky reason to mark a letter as spam.

Sorry, updated original task with version information. This is just one example message that got flagged, maybe some other messages have plain-text alternate?

Just checked other seems that all messages from Projects, Diffusion and Phriction come with just Content-Type: text/html; charset="utf-8"

I found just a few messages with Content-Type: text/plain; charset="utf-8" and that's [Phabricator] New User "xyz" Awaiting Approval

Funny though, your comment email notification has multiparts :) and my instance sends similar email with text/html. How is that possible?

Subject: [Maniphest] [Commented On] T12649: Phabricator email aren't HTML valid / properly formatted
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0a29f62b9a6d4cf5a67a9f0e781eec3e"

Content-Type: text/plain; charset="ascii"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit

avivey added a comment.

Something is rewriting your outgoing mail. We do not send mail with a <meta ..> tag (and never have), nor mail which doesn't have a text part (and never have).

(If you're using SendGrid, it is likely SendGrid.)

(We do send some mail missing an HTML part, see T6576, but all mail has a text part.)

Per above, I'm pretty confident this is on your end since I can't reproduce it and we don't generate mail like that.

Also, although it's not conclusive, phpmailer.smtp-encoding defaults to base64, not 7bit, further suggesting that something has rewritten the mail.

You can see the raw mail we attempt to send with bin/mail list-outbound / bin/mail show-outbound. I suspect it won't match what arrives in your client, and will also always have a text part.

If you think I'm mistaken, please file a new task with more complete reproduction instructions, e.g.:

  • Exactly how outbound mail is configured.
  • The bin/mail show-outbound output of a message which arrived with no text part.