Skip to content

email.message: header value parser get_msg_id throws IndexError on some invalid RFC822 Message-ID #117849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zougloub opened this issue Apr 13, 2024 · 4 comments
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@zougloub
Copy link
Contributor

zougloub commented Apr 13, 2024

Bug report

Bug description:

I was looping in my inbox and found an e-mail with a Message-ID that causes an unexpected exception to be thrown:

msgid = "<[[email protected]]>"
assert msgid.startswith("<[") and msgid.endswith("]>")
email_message = email.message.EmailMessage()
email_message["Message-ID"] = msgid # Throws IndexError

CPython versions tested on:

3.11

Operating systems tested on:

Linux

@zougloub zougloub added the type-bug An unexpected behavior, bug, or error label Apr 13, 2024
@serhiy-storchaka
Copy link
Member

This is a duplicate of #86650.

@serhiy-storchaka serhiy-storchaka closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@serhiy-storchaka
Copy link
Member

Or #105802.

@zougloub
Copy link
Contributor Author

Thank you @serhiy-storchaka , sorry for not finding an existing bug.

@serhiy-storchaka
Copy link
Member

Or #94306.

You are not the only one. There are currently three open issues for the same bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants