fix(GODT-2576): Correctly handle Forwarded messages from Thunderbird

Thunderbird uses `In-Reply-To` with `X-Forwarded-Message-Id` to signal
to the SMTP server that it is forwarding a message.
This commit is contained in:
Leander Beernaert
2023-11-16 15:48:04 +01:00
parent 51229cbb68
commit bf89d548d3
7 changed files with 142 additions and 6 deletions

View File

@ -786,6 +786,16 @@ func TestParseTextPlainWithDocxAttachmentCyrillic(t *testing.T) {
assert.Equal(t, "АБВГДЃЕЖЗЅИЈКЛЉМНЊОПРСТЌУФХЧЏЗШ.docx", m.Attachments[0].Name)
}
func TestParseInReplyToAndXForward(t *testing.T) {
f := getFileReader("text_plain_utf8_reply_to_and_x_forward.eml")
m, err := Parse(f)
require.NoError(t, err)
require.Equal(t, "00000@protonmail.com", m.XForward)
require.Equal(t, "00000@protonmail.com", m.InReplyTo)
}
func TestPatchNewLineWithHtmlBreaks(t *testing.T) {
{
input := []byte("\nfoo\nbar\n\n\nzz\nddd")