Thunderbirdで生成された返信からURLが削除される

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?

「いいね!」 1

Thanks for trying.

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

「いいね!」 1

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)?!

「いいね!」 1

The email:
grafik

The post:

「いいね!」 2

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?

「いいね!」 1

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

「いいね!」 4

皆さん、このトピックをフォローしていただきありがとうございます。

更新する前に、この問題に対する別の修正(同じようなものですが、より具体的です)がコミットされたことに気づきました。
issue: FIX: properly clean Thunderbird emails, don't remove links by ValdikSS · Pull Request #16543 · discourse/discourse · GitHub
commit: FIX: properly clean Thunderbird emails, don't remove links (#16543) · discourse/discourse@f7540aa · GitHub

これは、上記のコメントで添付されたパッチが、この新しいコミット(おそらく次のアップグレード)を含めるようにアップグレードする際に失敗することを意味します(おそらく「劇的」ではありませんが、その後、アップグレードを再度実行するために再構築が必要になる可能性があります)。
自動的に適用されている場合(たとえば、前述の app.ymlgit apply cmd を使用している場合)、次のアップグレードの前に削除する必要があります。実際、コミットが適用に失敗する可能性があるため、再構築が順調に進む可能性があります。コミット diff を適用しようとする receiver.rb の場所は、パッチによって既に変更されています。

私は 1) app.yml から git apply cmd を削除し、2) アプリを再構築し、3) 更新します(既に再構築中に更新されていない場合)。それがどのように進むかお知らせします…

[10分後…]

結局、再構築中にダウンタイムが発生しないため、代わりに次のことを行いました。

  1. app.yml からパッチの git apply を削除します(次のアプリコンテナの再構築前にのみ行う必要があります)。
  2. パッチが適用されたファイルを次のように元に戻します。
    i) launcher enter app
    ii) (アプリコンテナ内)
    cd /var/www/discourse
    git checkout ./lib/email/receiver.rb
    exit
  1. ウェブ管理者の更新を使用して Discourse を更新します。
「いいね!」 1

このパッチの作者は私です。私にとってはうまく機能し、欠点も見つかりませんでした。

「いいね!」 2