Skip to content
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

FWS handling in message ids #1607

Open
galdor opened this issue Mar 30, 2024 · 0 comments
Open

FWS handling in message ids #1607

galdor opened this issue Mar 30, 2024 · 0 comments

Comments

@galdor
Copy link

galdor commented Mar 30, 2024

I am curious about the behaviour of the parser for message ids.

Mail.read_from_string("Message-ID: < foo\r\n @ example.com\r\n >\r\n").header.fields[0].element.message_ids[0]

Yields " foo @ example.com ". It means that the library will return different results for message ids which are semantically identical but syntactically different, for example:

  • Message-ID: <[email protected]>\r\n
  • Message-ID: < foo@\t example.com> \r\n
  • Message-ID: \r\n <\r\n\t foo \r\n @example.com>\r\n

Unless I am mistaken, all these representations are semantically identical (see RFC 5322 3.6.4., msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS])and I would expect message ids to be parsed as an object with two fields, left and right. In all these examples, left would be foo and right would be example.com.

Is there a reason behind the current behaviour?

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

No branches or pull requests

1 participant