discourse/spec/fixtures/emails/exchange_html_reply.eml
Régis Hanol d523c37057
FIX: correctly extract body and/or reply from exchange emails (#30512)
When receiving emails sent with Exchange, we look for some markers to identify the body of the mail and the reply (aka. previous email).

For some reasons, those markers aren't 100% reliable and sometimes, only one of them is present.

The commit 20ba54d536 introduced the bug because the `HTML_EXTRACTERS` regex for exchange looks for either `messageBodySection` or `messageReplySection` but we were only using the `reply` section. So if an email had only the `body` section, it would not be correctly extracted.

This commit handle the cases where either one of them is missing and use the other one as the actual "reply". When both are present, it correctly elides the "reply" section.
2024-12-31 15:29:36 +01:00

15 lines
396 B
Plaintext

Return-Path: <discourse@bar.com>
From: Foo Bar <discourse@bar.com>
To: alt+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com
Date: Fri, 15 Jan 2017 00:12:43 +0100
Message-ID: <180@foo.bar.mail>
Mime-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div>
<div name="messageReplySection">
<p>This is the <b>body !!</b> of the email.</p>
</div>
</div>