Open
Description
Bug report
Bug description:
I'm seeing many emails with headers broken across multiple lines. When this happens to Message-Id, the parsed header value will include a leading space:
eml = dedent("""\
From: "Foo Bar" <foo@bar.com>
To: Baz Baq <baz@baq.com>
Date: Thu, 22 May 2025 16:15:44 +0000
Message-ID:
<BY5PR09MB5490557EF2B28EC8E707108FBF99A@BY5PR09MB5490.namprd09.prod.outlook.com>
Content-Type: text/plain
Hello
""")
msg = Parser(policy=default_policy).parsestr(eml)
print(f"|{msg['Message-ID']}|") # prints | <BY5PR09MB5490557EF2B28EC8E707108FBF99A@BY5PR09MB5490.namprd09.prod.outlook.com>|
CPython versions tested on:
3.11
Operating systems tested on:
Linux