Page MenuHomePhabricator

SendGrid generates HTML email bodies from thin air? (◟ᅇ)◜
Closed, WontfixPublic

Description

Currently the emails sent out by phabricator do not contain links that are clickable. This is annoying because I have to copy/paste the links into my browser each time (when reviewing a new diff revision for instance).

For the HTML version of the emails, you can simply use an <a target="_blank" href=""> tag, and for the plain text version, wrap the url in < > (i.e. <http://www.google.com>. This will cause email clients to properly pick up the link and make it clickable.

Event Timeline

xxkylexx raised the priority of this task from to Needs Triage.
xxkylexx updated the task description. (Show Details)
xxkylexx added a subscriber: xxkylexx.

What email client are you using that links aren't clickable?

Thunderbird. The weird thing is that the email I just received from your comment to this task was clickable, however, the emails I receive from our phab instance are not.

Yeah I've never heard of links not working, maybe @epriestley has some ideas on what to poke on your install.

Here is an example of the source of an email from our install:

This is a multi-part message in MIME format...

------------=_1386173199-31144-13
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

dhaney added a commit: rPCdb79c7290396: Preparing for multiple search servi=
ces (reporting, passtemplates).

TASK DETAIL
  https://devportal.imobile3.com/T5527

To: dhaney
Cc: slegg, mbishop, cferguson, kspearrin

------------=_1386173199-31144-13
Content-Type: text/html; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html><body>
<p>dhaney added a commit: rPCdb79c7290396: Preparing for multiple search se=
rvices (reporting, passtemplates).</p>
<p>TASK DETAIL</p>
<pre>https://devportal.imobile3.com/T5527</pre>
<p>To: dhaney Cc: slegg, mbishop, cferguson, kspearrin</p>

------------=_1386173199-31144-13--

As you can see, there is no linking in the HTML. This seems to be confusing the email client and sometimes the client can figure it out and link it, and other times it will not.

We don't ever send HTML email. I don't have a copy of Thunderbird handy, but both Mail.app and Gmail link URLs in plain text bodies without <...> delimiters.

Guesses:

  1. Is your domain name something unsual like http://oneword/ or http://☃/?
  2. Is your mail gateway mutating the mail? You can view the raw version and make sure there's no HTML body. The expectation is that we never send mail with an HTML body.

Ah, okay. I don't know what's adding that HTML body, but it shouldn't be us. Which mail adapter are you using (metamta.mail-adapter)? It's possible one of them misbehaves like this. Something between Phabricator and you might also be messing with the mail body.

(None of the mailers in the upstream have <html>, <body> or <pre> in their sources, although this doesn't absolutely mean it isn't our fault.)

Looks like we are using sendgrid as our email server, so maybe it is doing the HTML work.

Go check this box on your SendGrid account?

convert.png (932×1 px, 158 KB)

I just sent myself a plaintext email using thunderbird and it does the linking just fine when viewed:

Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

http://www.google.com

<http://www.google.com>

Not sure why it cant figure out the phab links. I had this same problem with windows 8 mail, but I figured it was just cause that "app" is garbage.

I'll see if I can get someone to play with some settings. Unfortunately I do not have access to the admin rights for these accounts here at work.

That will also affect the entire account, so it might break something if you're using SendGrid for other things and relying on this behavior, although it seems like a fairly bad behavior in general.

If that fixes it, we can update the docs. Might be a good time to look into T3435, too, and it looks like there's a new preferred API endpoint: http://support.sendgrid.com/hc/en-us/articles/200738596-New-Web-API-URL-api-sendgrid-com

We may also eventually support HTML email (T992), which would let us send an appropriate HTML body, but I believe this is nightmarishly difficult and relatively low value.

(In any case, let me know what the outcome is and we can figure out how to react based on that.)

I suppose that hypothetically we could also try to send ourselves mail and then see if the gateway mutated it in order to raise a setup warning, but that seems even more nightmarishly difficult to implement robustly.

epriestley renamed this task from Make Email Links Clickable to SendGrid generates HTML email bodies from thin air?.Dec 5 2013, 5:27 AM
epriestley assigned this task to xxkylexx.
epriestley triaged this task as Low priority.
epriestley added a project: Mail.
chad renamed this task from SendGrid generates HTML email bodies from thin air? to SendGrid generates HTML email bodies from thin air? (◟ᅇ)◜.Dec 5 2013, 5:28 AM

Closing for lack of feedback, but I assume this was the Sendgrid setting.

epriestley added a subscriber: mbishopim3.

@mbishopim3 (who works with @xxkylexx) is reporting that SendGrid is now mangling a bunch of headers into mail bodies. I'm going to see if I can reproduce that locally, since that's way worse than not linking links.

I can't reproduce any of this locally. We've made some adjustments to how we communicate with SendGrid, and now have an option to send HTML mail bodies (T992) which will be selectable as a global default once it sorts out a bit. Hopefully some of that will resolve things.

In general, we now recommend MailGun (which we've seen zero issues with) over SendGrid (which we've had a lot of issues with).