From 7d014f2c405f05d9ca3471b794e90940d7b852c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 11 Apr 2023 14:08:06 +0200 Subject: pkg/email: parse multiple In-Reply-To message IDs Even though the standard seems to prohibit it, there are real world cases of messages with multiple IDs in an "In-Reply-To" header. --- pkg/email/parser_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'pkg/email/parser_test.go') diff --git a/pkg/email/parser_test.go b/pkg/email/parser_test.go index 151d259b8..81a532648 100644 --- a/pkg/email/parser_test.go +++ b/pkg/email/parser_test.go @@ -910,4 +910,32 @@ Reported-by: syzbot `, Command: CmdNone, }}, + {`Sender: syzkaller-bugs@googlegroups.com +Subject: Some discussion +To: +From: bar +Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> +Date: Sun, 7 May 2017 19:54:00 -0700 +MIME-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Language: en-US +Content-Transfer-Encoding: quoted-printable +In-Reply-To: <000000000000f1a9d205f909f327@google.com> + <000000000000ee3a3005f909f30a@google.com> +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +Some text +`, Email{ + MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", + // The first one should be picked up. + InReplyTo: "<000000000000f1a9d205f909f327@google.com>", + Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), + Subject: "Some discussion", + Author: "bar@foo.com", + Cc: []string{"bar@foo.com", "someone@foo.com"}, + Body: "Some text\n", + Command: CmdNone, + }}, } -- cgit mrf-deployment