# URLs worden weggelaten uit door Thunderbird gegenereerde antwoorden

**URL:** https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751
**Category:** Support
**Created:** [11 september 2020 om 16:39 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751 "2020-09-11T16:39:32Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![bsoares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bsoares/32/231482_2.png) [@bsoares](https://meta.discourse.org/u/bsoares)
#### Post date: [4 oktober 2021 om 14:32 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/24 "2021-10-04T14:32:22Z")

</div>

Hmmm, in that example, and in the full email source you messaged me (thank you!) the `moz-do-not-send` attribute should not affect the display of the `<img>` or `<a>` tags that that attribute appears in. The mozfilter is only looking at values in the `class` attribute, and I can’t immediately see anywhere else that it might get filtered.

As such I can’t work out why the link-with-alias’s content and href get separated out, unless for some reason the discourse importer is suddenly deciding to use the plain/text part of the Mime encoded email (which does have the text and URL separated). Why it would do that I don’t know.

In your test discourse setup can you try importing/emailing a thunderbird HTML email with both a link-with-alias and, say an embedded image or something else that will mark it out as the HTML part of the email?

---

<div class="post-metadata">

### Author: ![Flominator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flominator/32/235031_2.png) [@Flominator](https://meta.discourse.org/u/Flominator)
#### Post date: [4 oktober 2021 om 16:32 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/25 "2021-10-04T16:32:13Z")

</div>

Thanks for trying.

> [@bsoares](#):
>
> In your test discourse setup can you try importing/emailing a thunderbird HTML email with both a link-with-alias and, say an embedded image or something else that will mark it out as the HTML part of the email?

Then the picture which in the mail in between the text (left) turns to be at the end in Discourse (right):

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/5/6/56779605f2da011d9d70e5d869ceb7b490ef453f.png)

---

<div class="post-metadata">

### Author: ![bsoares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bsoares/32/231482_2.png) [@bsoares](https://meta.discourse.org/u/bsoares)
#### Post date: [5 oktober 2021 om 08:52 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/26 "2021-10-05T08:52:42Z")

</div>

I’m still thinking this might be discourse using the other mime parts (in this case a plain/text part followed by an image/… part of the email to create its markdown version, though why I don’t know. Perhaps an HTML validator is rejecting the text/html part because of strictly-non-validating attributes like moz-do-not-send!?  
Could you do one more test, with the same post (some text with an image in the middle, but also make some (but not all) of the text bold, even just one work. I think that will determine if the text part is coming from a text/plain or text/html block.

And sorry to ask, but just to make sure, you have `incoming_email_prefer_html` set to true (checked)?!

---

<div class="post-metadata">

### Author: ![Flominator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flominator/32/235031_2.png) [@Flominator](https://meta.discourse.org/u/Flominator)
#### Post date: [16 oktober 2021 om 10:00 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/27 "2021-10-16T10:00:23Z")

</div>

> [@bsoares](#):
>
> Could you do one more test, with the same post

The email:

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/4/6/46530fbce665aee9760adb70634b793085bd27c3.png)

The post:

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/5/2/52a19f0625acc0c8b1e0a99b59274eba35b4021d.jpeg)

---

<div class="post-metadata">

### Author: ![bsoares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bsoares/32/231482_2.png) [@bsoares](https://meta.discourse.org/u/bsoares)
#### Post date: [25 oktober 2021 om 10:50 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/28 "2021-10-25T10:50:24Z")

</div>

Thanks @Flominator . I see that the emboldened text has become italicised, so it’s definitely not using the HTML directly, but it is picking up on the emphasis somehow. I wonder if the text/plain part of the email gets some kind of markup/down added – would you be able to PM me the email source like last time?

---

<div class="post-metadata">

### Author: ![bsoares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bsoares/32/231482_2.png) [@bsoares](https://meta.discourse.org/u/bsoares)
#### Post date: [27 oktober 2021 om 11:13 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/29 "2021-10-27T11:13:03Z")

</div>

Hi @Flominator , thanks for the raw email. Looking at the text/plain alternative part of the email does indeed put asterisks around the text that’s in bold in the text/html part. Most markdown renderers (such as the one in discourse) interpret this as italicised. Here’s the text/plain segment copied and pasted on its own:

> Und nochmal soll ich für hier  
> [https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/24](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/24)  
> eine Testnachricht schicken.
> 
> Bild in die Mitte dann wieder Text von dem ein Teil _sogar fett  
> geschrieben_ ist
> 
> Gruß
> 
> Flo

which looks identical to your screenshot.

So what I think is happening is that the text/html segment is being rejected as invalid HTML (probably down to the non-standard `moz-do-not-send` attribute name in the `a` tags). This will require the patch to change how valid HTML is checked (possibly just removing those attributes) and I’m less confident how stable that will be without it going into the core code. I’ll have a look when I get some time.

---

<div class="post-metadata">

### Author: ![bsoares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bsoares/32/231482_2.png) [@bsoares](https://meta.discourse.org/u/bsoares)
#### Post date: [26 april 2022 om 08:56 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/30 "2022-04-26T08:56:39Z")

</div>

Hi all following this topic,

I’ve just spotted (before updating) that a separate fix (along the same lines but more specific) for this issue has been committed:  
issue: [FIX: properly clean Thunderbird emails, don't remove links by ValdikSS · Pull Request #16543 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/16543)  
commit: [FIX: properly clean Thunderbird emails, don't remove links (#16543) · discourse/discourse@f7540aa · GitHub](https://github.com/discourse/discourse/commit/f7540aa52f1f2eb97cd111890187132871463cf1)

This means that the patch attached in an above comment will fail (probably not “spectacularly” but it might then require a rebuild to get upgrades going again) when you upgrade to include this new commit (probably your next upgrade).  
If you have it automatically being applied (e.g. with a `git apply` `cmd` in your app.yml as described above), you should remove that before your next upgrade. In fact a rebuild might be in order as that commit might fail to apply since the place in receiver.rb where it will want to apply the commit diff has already been changed by the patch.

I’m going to 1) remove the `git apply` `cmd` from app.yml, 2) rebuild app, 3) update (if it hasn’t already in the rebuild). I’ll let you know how that goes…

[10 minutes later…]

In the end I did the following instead because it doesn’t require any downtime during the rebuild.

1. remove the `git apply` for the patch from app.yml (only needs to be done before your next app container rebuild)
2. revert the patched file with:  
i) `launcher enter app`  
ii) (now in app container)  
`cd /var/www/discourse`  
`git checkout ./lib/email/receiver.rb`  
`exit`

1. update discourse using the web admin update

---

<div class="post-metadata">

### Author: ![ValdikSS](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/valdikss/32/157221_2.png) [@ValdikSS](https://meta.discourse.org/u/ValdikSS)
#### Post date: [28 april 2022 om 14:27 UTC](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751/31 "2022-04-28T14:27:26Z")

</div>

I’m the author of this patch. It works great for me, and I found no drawbacks.

[Vorige pagina](https://meta.discourse.org/t/urls-being-dropped-from-thunderbird-generated-replies/163751.md?page=1)
