`enable_forwarded_emails` verhält sich nicht wie konventionelles E-Mail-Forwarding

enable_forwarded_emails is a great feature for bringing existing conversations into Discourse, but for users who approach Discourse with a “Mailman-mind” - as many users on our instance do - this feature just doesn’t do what they’re expecting it to.

Within every email client I’ve used, forwarding an email intentionally excludes the original email address from the forward, and subsequent replies. Whereas with this feature, that original email address is included in the created post and subsequent replies.

If this feature isn’t enabled, then Discourse strips the actual forwarded email, which also doesn’t work for us.

My thought is there should be an alternative feature which doesn’t strip the forwarded email and posts it like so:

Thought you all should see this:

---------- Forwarded message ---------
From: Example Person <person@example.com>
Date: Wed, 13 Mar 2019 at 15:11
Subject: An email to be forwarded
To: <some_discourse_user@example.com>

The original email

This would be a lot like the result of the always_show_trimmed_content setting, but with the trimmed content automatically expanded (and therefore visible in email notifications).

@zogstrip what are your thoughts here?

With just a little bit of rejigging of the code you’ve already written for enable_forwarded_emails I think what I want to see would be relatively easy - and that’s rejigging I’m happy to do.

Perhaps the solution here is to create a new multiple-choice site setting, something like:

forwarded_emails_behaviour:

  • hide (default)
  • show (the behaviour I’m advocating for here)
  • create_replies (the existing enable_forwarded_emails behaviour)
9 „Gefällt mir“

I like that :+1:

PR at will :wink:

5 „Gefällt mir“

It took me a little while, but here’s the PR:

8 „Gefällt mir“

Currently, this setting has these options available:

So I suppose the “show” option became “quote”?

Also, I don’t quite get why the other option is called “create replies”. What does it mean? (or: what does it do?)

Yep, as both other options “show” the forwarded email, but this one quotes in in the original post.

What it says on the :canned_food:! It’ll attempt to parse the forwarded email, then create a staged user from the original sender of the forwarded email, and post the forwarded email as the original topic and then any text the forwarder includes as a reply to that topic (at least that’s the way round I remember it working).

4 „Gefällt mir“

Aah, now I get it. It’s the text that the forwarder includes that becomes the reply! But that’s exactly one reply. Why does it say create replies?

Another reason why the terminology is somewhat confusing: both “hide” and “quote” refer to the forwarded text but “create replies” refers to the forwarders commentary om the forwarded text. So perhaps these options could be clarified somehow by saying

  • hide forwarded email
  • quote forwarded email
  • post forwarded mail with replies

As I write, I’m wondering whether this third option is really how it works. I don’t think it ever behaved like that for us but then again we don’t have a lot of forwarded mails, so I’m not sure. Does it even make sense to post the forwarders comment as a reply? Shouldn’t it somehow be made clear that the forwarded email was posted by the forwarder? This is not at all clear when you have the forwarder apparently reply to it.

3 „Gefällt mir“

So I’m using the quote setting and it definitely doesn’t work as described. Maybe I’m still misunderstanding the intended behaviour but this seems pretty clear:

and this is not what I’m getting. So let me be mote precise in what I’m getting: someone forwarded an email starting with a short note like “Look at this” followed by the forwarded email. The forwarded email included text as well as two pdf files as attachments. The post shown on the forum looked like this:

Look at this!
Cheers,
Sara

document1.pdf
document2.pdf

That was all.

So the forwarded email was completely stripped with the exception of the file attachments. I was able to recover it manually and it even started with ---------- Forwarded message --------- so identifying it could not have been easier…

Hmm, I wonder if the attachments are messing things up here. This is how they (correctly) appear for me: Fwd: email to site-feedback.support - Support - Mozilla Discourse Dev

3 „Gefällt mir“

Okay, that looks just like I’d expect it. Good to see that it works at least under certain circumstances. But did your email include an attachment? If not, it seems plausible that discourse is confused by (certain?) attachments.

I’m still having issues with forwarded emails not being displayed. Since I do have at least one email with attachments that was correctly rendered, my guess is now that it has to do with whether the person forwarding the email added something to the email or not. From what I can see, emails that were forwarded without adding any text above the forwarded email were rendered correctly but if the forwarder added something like “FYI”, only the attachments are included in the post but not the text of the forwarded email.

In other words, this example still doesn’t work (because it includes “Thought you all should see this:”):

Instead of the above result, this email would be rendered as:

Thought you all should see this:

And nothing else.

Could someone confirm whether this problem is specific to my instance or whether it exists also elsewhere?

Please check emails with an attachment in particular (e.g. a pdf file) as it is possible that the problem only occurs when text is added AND there is an attachment.

I also am still confused what these different labels/features do – trying to set up incoming email to use with the Tickets Plugin :tickets: but getting inconsistent behavior.

I feel like the default behavior should be that whatever gets forwarded in becomes a post by the (staged or regular user) that created the message. The reason it’s getting forwarded seems to most often be that someone who got the message felt it would be better addressed on Discourse, so that topic seems most appropriate to be started by the email’s author, not the forwarder.

(But maybe my use cases are actually edge cases…)

Das sollte so funktionieren, wenn du enable_forwarded_emails auf create_replies setzt. Die weitergeleitete E-Mail wird dann der erste Beitrag, und es wird eine Antwort erstellt, falls der Weiterleiter Text hinzugefügt hat. Andernfalls wird ein kleiner Aktionsbeitrag erstellt, damit klar ist, wer den ersten Beitrag weitergeleitet hat.

2 „Gefällt mir“

OK, ich denke, ich lerne das endlich –

Wenn create_replies der ausgewählte Wert für die Site-Einstellung „Verhalten bei weitergeleiteten E-Mails

Nein. Wenn vor der weitergeleiteten Nachricht kein Text steht, erhalten Sie einen kleinen Aktionsbeitrag.

Ich glaube, diese Funktion ist immer noch als experimentell gekennzeichnet, und dafür gibt es einen guten Grund. E-Mails werden meist inline weitergeleitet. Das macht es ziemlich schwierig, die weitergeleitete E-Mail zu extrahieren, da jeder Client die ursprünglichen E-Mail-Header unterschiedlich weiterleitet. Manche verbergen sogar die E-Mail-Adresse im ursprünglichen From-Header oder verwenden lokalisierte Header.

Es sollte viel besser funktionieren, wenn E-Mails als Anhang statt inline weitergeleitet werden (ich bin mir zu 99 % sicher, dass Discourse das unterstützt).

1 „Gefällt mir“

Ich stimme zu, dass dies ein viel saubererer Weg wäre, um eine korrekte Verarbeitung sicherzustellen. Ich frage mich, warum ich Discourse nicht dazu bekomme, die Anhänge zu verarbeiten, wenn ich es tue. (Der Inhalt des weitergeleiteten Anhangs erscheint im Rohinhalt, der dem Beitrag zugeordnet ist, aber nur der „Kommentar

1 „Gefällt mir“

Vielleicht ist es doch nicht implementiert? Ich habe mir den Code noch nicht angesehen. :blush:
Bitte gib Rückmeldung, ob es mit anderen Clients funktioniert.

1 „Gefällt mir“

Nachrichtenvorwärtssendungen inline werden abgeschnitten, sowohl im quote- als auch im create_replies-Modus.

Irgendwelche Vorschläge?

Originalnachricht (einige Header entfernt):

Von: Jeffrey Nachname <jeff@myemail.us>
An: test-cat@example.org
Betreff: Fwd: Vielen Dank für Ihre Unterstützung!
X-Mailer: MailMate (1.14r5745)
Content-Type: text/plain; format=flowed

Einige wirklich lange Beispieltexte.

Weitergeleitete Nachricht:

> Von: Donationsteam <giving@example2.org>
> An: jeff@myemail.us
> Betreff: Vielen Dank für Ihre Unterstützung!
>
> Sehr geehrter Jeffrey,
>
> Unser aufrichtiges Dankeschön für Ihre Spende an das Beispielprojekt, 
> besonders jetzt. Gemeinsam werden wir die Zukunft gestalten.

Nachricht im Forum (gleich für beide Modi):

Einige wirklich lange Beispieltexte.

Weitergeleitete Nachricht:

Das Weiterleiten der Nachricht als Anhang funktioniert ebenfalls nicht. eml-Anhänge werden abgelehnt. Wenn eml-Anhänge autorisiert sind, wird im Modus „create_replies

Gibt es eine Möglichkeit, dass E-Mail-Benachrichtigungen die weitergeleitete E-Mail anzeigen?

Mit

  • forwarded_emails_behaviour auf “quote” gesetzt und
  • always_show_trimmed_content aktiviert,

zeigt unsere Discourse-Website (2.6.0, stabil) die weitergeleitete E-Mail genau so an, wie man es sich wünscht, sobald man auf die drei Punkte klickt:

Allerdings enthält die E-Mail-Benachrichtigung die weitergeleitete E-Mail überhaupt nicht:

1 „Gefällt mir“