Skip to content

gh-86650: get_obs_local_part() fails to handle empty local part #24669

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

Conversation

ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Feb 28, 2021

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Mar 31, 2021
@spacefreak86
Copy link

What exactly is missing for this PR to get applied? It would be great because this bug is affecting my productive system and I have to monkey-patch the email library by myself.

Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran 1654 tests in 6.561s
OK (skipped=1)
Looks ok.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 4, 2022
@lesleyxyz
Copy link

I am getting this bug in a production environment.
It seems emails from the sender [email protected] have a message id starting with <[

How is this PR not yet reviewed after- all this time? How can we notify the right people to review this?

@arhadthedev
Copy link
Member

@python/email-team

@arhadthedev arhadthedev changed the title bpo-42484: get_obs_local_part() fails to handle empty local part gh-86650: get_obs_local_part() fails to handle empty local part Feb 27, 2023
@mdavranche
Copy link

Same here, got this on my production environment, preventing me to upgrade from Python 3.7.3 (bug not present) to a more recent version (bug confirmed in 3.8, 3.9, 3.10, 3.11).

Easy to trigger:

import email.parser
import email.policy
faulty_header = "Message-ID: <[9f83415a58f84675bac8ab3e6047a157-JFBVALKQOJXWILKCJQZFA7CJIFGVGU2QKJ6FGU2QKJCW2YLJNR6EK6DPKNWXI4A=@example.com]>"
message = email.parser.BytesParser(policy=email.policy.default).parsebytes(faulty_header.encode("utf-8"))
message.as_bytes()

@lesleyxyz
Copy link

Is there an ETA for this please?

@fsc-eriker
Copy link
Contributor

fsc-eriker commented Feb 9, 2024

I have a competing PR which does not simply silently ignore the problem, but instead raises a defect. My proposed implementation returns a partial message-id which is perhaps less than ideal.

#108133

@serhiy-storchaka
Copy link
Member

Thank you for your contribution, @ZackerySpytz, but I think that it is not a correct solution. Invalid Message-ID should not be silently truncated. The parsing code should raise HeaderParseError, this will allow to preserve its literal value. See #117934.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.