Page MenuHomePhabricator

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

Description

Hello,

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">
<table>
<tr>
<td style="">bbrdaric-test added a project: Some project.
</td>
</tr>
</table>
<br>
<div><strong>TASK DETAIL</strong>
<div><a href="https://phabricator.local/T123" rel="noreferrer">https://phabricator.local/T123</a>
</div>
</div>
<br>
<div><strong>EMAIL PREFERENCES</strong>
<div><a href="https://phabricator.local/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.local/settings/panel/emailpreferences/</a>
</div>
</div>
<br>
<div><strong>To: </strong>bbrdaric-test
<br>
</div>

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,
BAYES_999,EXIM_ESV_DEFER,EXIM_HSV_DEFER,HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,
MIME_HTML_ONLY,RP_MATCHES_RCVD,URIBL_BLOCKED autolearn=no

https://wiki.apache.org/spamassassin/Rules/MIME_HTML_ONLY
https://wiki.apache.org/spamassassin/Rules/HTML_MIME_NO_HTML_TAG

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

avivey added a subscriber: avivey.Apr 27 2017, 4:21 PM

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.

bbrdaric updated the task description. (Show Details)Apr 27 2017, 5:34 PM

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 mails...it 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"

--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.)

epriestley closed this task as Invalid.Apr 30 2017, 7:21 PM

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.