The Message-Id of an incoming mail is partially parsed

Bonjour,

In the two emails (attached) the Message-Id field looks like this:

Message-Id: =?us-ascii?Q?<937921.143a05a8b3cfad92dd74ccf3c20c29a0@seenth?=
 =?us-ascii?Q?is.net>?=

In 2.7.9 and 2.8.0 it is parsed by Email::Receiver as =?us-ascii?Q?, i.e. only part of the second line. As a consequence all messages after the first are silently discarded because they are mistaken to have the same Message-Id.

Parsing mail1.txt (below) with python3 shows the following Message-Id:

$ ( echo import email ; echo 'print(email.message_from_string(open("mail1.txt").read())["Message-Id"])' ) | python3 
=?us-ascii?Q?<937921.143a05a8b3cfad92dd74ccf3c20c29a0@seenth?=
 =?us-ascii?Q?is.net>?=

It appears to be a bug in the Mail parser class used by discourse around here:

Thanks a lot for any advice you may have to fix or workaround this problem.

mail1.txt (3.6 KB)
mail2.txt (3.6 KB)

2 Likes