Bug report
Bug description:
If an email message with attachments contain a boundary with the characters "<--- ... --->" the email.parser module fails to recognize the message as being multipart.
I have attached to this bug report an example mailbox file, and when the following snippet is run on it you will see that is_multipart() returns False, although the message is clearly a multipart message.
I found this boundary string used in a real life email I received.
from email.parser import Parser
# Create parser instance
P = Parser()
with open("message-error.mbox") as f:
msg = P.parse(f)
print(msg.is_multipart())
message-error.txt
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
If an email message with attachments contain a boundary with the characters "<--- ... --->" the email.parser module fails to recognize the message as being multipart.
I have attached to this bug report an example mailbox file, and when the following snippet is run on it you will see that
is_multipart()returnsFalse, although the message is clearly a multipart message.I found this boundary string used in a real life email I received.
message-error.txt
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
email.message.Message.get_boundarystrips boundaries twice #135891