Links in mail lack http(s) protocol


(Sander Datema) #1

The mail sent out with a post’s contents will show a correct link http://link.to/someplace, but the underlying HTML is missing the protocol, causing iOS (don’t know about Android) to change the link to x-apple-msg-load://link.to/someplace. And that’s a dead end.

BTW, this only happens for links entered by the user. Links for mentions, etc. work fine.


Links to attachments in mail still lack protocol
Full URL for image in text/plain emails
(Sander Datema) #2

Hmm… Seems quite a few things are related here:

https://meta.discourse.org/t/force-http-instead-of-https-in-invitation-emails/15036?source_topic_id=15794 https://meta.discourse.org/t/url-auto-linking-does-not-specify-http-s/15796?source_topic_id=15794

And maybe:


(Sam Saffron) #3

Can you confirm this also happens here on meta?


(Sander Datema) #4

Can’t confirm it on Meta, cause it seems to happen in very specific cases. When posting a link to a topic in a private category, no onebox will be created. And in those (and only those) cases it goes wrong.

So @sam, you could try to reproduce this by linking to a topic in a private category here.

Any other link works fine.


(Sander Datema) #5

Turns out it’s also broken for some webmail clients, like FastMail.

@Sam, where are weblinks in posts parsed? It must be somewhere else than where Discourses own created links are parsed.


(Peter N Lewis) #6

I hit this missing “http:” in emails as well. Or maybe it is having two links. I have support for some not image file extensions (namely kmmacro). If I post a message with an image and a kmmacro file, the resulting email looks like this:

Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

<a class=“attachment” href="/uploads/default/35/328db47796f9fad2.kmmacros">Reminder.kmmacros</a> (5.7 KB) <img src="/uploads/default/36/f43857831454a49a.png" width=“668” height=“1860”>

Which is clearly broken, its HTML even though its in the plain text section, and its missing the http:/ /forum.keyboardmaestro.com (deliberately added a space to avoid links) in the links.

And then the Content-Type: text/html section includes this:

<p style=“margin-top:0;”><a href="//forum.keyboardmaestro.com/uploads/default/35/328db47796f9fad2.kmmacros" style=“text-decoration: none; font-weight: bold; color: #006699;”>Reminder.kmmacros</a> (5.7 KB) <img src=“http://forum.keyboardmaestro.com/uploads/default/36/f43857831454a49a.png” width=“668” height=“1860” style=“max-width: 694px;”></p>

The “http:” is missing from the kmmacros link, but the image link is ok.

Does meta support any non-image file types? If so I can test that.


(Sam Saffron) #7

Related:


(Sander Datema) #8

Yes, that is the same thing. I hope there’s a solution.


(Sam Saffron) #9

There certainly is, we just need to walk the dom of the message we are sending. Will see if I can sort it this week.


(Peter N Lewis) #10

I have put a pull request through that will correct the plain text emails. I suspect this is entirely unrelated to the missing protocol issue (which I presume @sam has resolved since then as it doesn’t appear in any of my tests).


(Jeff Atwood) #11

It was @eviltrout who worked on fixing (removing) protocol agnostic URLs in emails. We can close all related topics if it is working now.


(Peter N Lewis) #12

As far as I can tell it is working in the text/html part of the email. There are bit problems with it in the text/plain part of the email (which thankfully most people don’t see these days).


(Robin Ward) #13