mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 10:32:45 +08:00
d523c37057
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.
15 lines
392 B
Plaintext
15 lines
392 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="messageBodySection">
|
|
<p>This is the <b>body</b> of the email.</p>
|
|
</div>
|
|
</div>
|