Skip to content

bpo-43501: _header_value_parser: handle DOT in DisplayName#24874

Open
elenril wants to merge 1 commit intopython:mainfrom
elenril:bpo43501_email_displayname_dot
Open

bpo-43501: _header_value_parser: handle DOT in DisplayName#24874
elenril wants to merge 1 commit intopython:mainfrom
elenril:bpo43501_email_displayname_dot

Conversation

@elenril
Copy link
Copy Markdown
Contributor

@elenril elenril commented Mar 15, 2021

@elenril elenril requested a review from a team as a code owner March 15, 2021 13:29
@the-knights-who-say-ni
Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@elenril

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@github-actions
Copy link
Copy Markdown

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 Apr 16, 2021
@elenril
Copy link
Copy Markdown
Contributor Author

elenril commented Apr 23, 2021

Ping.

Still waiting for review.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Apr 24, 2021
@akulakov
Copy link
Copy Markdown
Contributor

akulakov commented Jul 3, 2021

The question is, should this be parsed or should it raise a more informative error, e.g. something like "name should be quoted"?

Can you find the relevant RFC rule?

I tested it and if the name is quoted, it's parsed successfully:

msg = EmailMessage()
msg["to"] = '"name."<a@b.com>'
print (msg.as_string())

to: "name."<a@b.com>

@elenril
Copy link
Copy Markdown
Contributor Author

elenril commented Nov 1, 2021

Honestly I see little point in spending effort on finding whether this might or might not be compatible with some obscure obsolete syntax or not. According to the comments in the source this already adds an
InvalidHeaderDefect, and I've only seen this happen in broken spam emails, so I only care about Python not leaking random exceptions. How exactly such emails are handled does not matter to me. If you, or anyone else,
has an opinion on how precisely to handle this, then suggestions are welcome. I personally have no opinion either way.

@elenril elenril force-pushed the bpo43501_email_displayname_dot branch from 1788507 to 4803262 Compare September 8, 2023 11:23
@elenril
Copy link
Copy Markdown
Contributor Author

elenril commented Sep 8, 2023

Ping.
Would appreciate some progress on this.

A DisplayName is merely a wrapper around a Phrase. However, its property
methods fail to deal with the fact that a phrase may contain DOT
terminals in addition to words.

Fixes processing headers, such as:
From: foobar.<baz@spam>
@elenril elenril force-pushed the bpo43501_email_displayname_dot branch from 4803262 to 94eaac6 Compare February 24, 2024 09:50
@elenril
Copy link
Copy Markdown
Contributor Author

elenril commented Feb 24, 2024

Ping.
Rebased against current upstream.

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.

5 participants