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

email: address list folding encodes list-separator comma #100884

Closed
t-8ch opened this issue Jan 9, 2023 · 0 comments · Fixed by #100885
Closed

email: address list folding encodes list-separator comma #100884

t-8ch opened this issue Jan 9, 2023 · 0 comments · Fixed by #100885
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@t-8ch
Copy link
Contributor

t-8ch commented Jan 9, 2023

Bug report

When during address list folding a separating comma ends up on a folded line containing that is to be unicode-encoded than the separator itself is also unicode encoded. Instead the comma should still a plain comma.

This is rejected by some mail servers:

ZZZ: host YYY said:
    550 Invalid address in message header. Consult RFC2822. (in reply to end of
    DATA command)

Minimal example:

>>> import email
>>> m = email.message.EmailMessage()
>>> t = '01234567890123456789012345678901234567890123456789012345678901@example.org, ä <foo@example.org>'
>>> m['to'] = t
>>> m.as_string()
'to: 01234567890123456789012345678901234567890123456789012345678901@example.org\n =?utf-8?q?=2C?= =?utf-8?q?=C3=A4?= <foo@example.org>\n\n'

Your environment

  • CPython versions tested on: 3.10.9, latest main (e47b139)
  • Operating system and architecture: ArchLinux x86_64

Linked PRs

@t-8ch t-8ch added the type-bug An unexpected behavior, bug, or error label Jan 9, 2023
t-8ch added a commit to t-8ch/cpython that referenced this issue Jan 9, 2023
There already is already a predefined object with the correct
properties, use it.
t-8ch added a commit to t-8ch/cpython that referenced this issue Jan 9, 2023
…tors

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.

Fixes python#100884
t-8ch added a commit to t-8ch/cpython that referenced this issue Jan 9, 2023
…tors

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.

Fixes python#100884
mricon added a commit to mricon/b4 that referenced this issue Jan 9, 2023
This tests for the bug reported here:
python/cpython#100884

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
serhiy-storchaka pushed a commit that referenced this issue Feb 17, 2024
…H-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 17, 2024
…tors (pythonGH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 17, 2024
…tors (pythonGH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
serhiy-storchaka pushed a commit that referenced this issue Feb 17, 2024
…ators (GH-100885) (GH-115592)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
serhiy-storchaka pushed a commit that referenced this issue Feb 17, 2024
…ators (GH-100885) (GH-115593)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…tors (pythonGH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…tors (pythonGH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue May 16, 2024
Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue May 16, 2024
Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
serhiy-storchaka added a commit that referenced this issue May 22, 2024
Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 22, 2024
)

Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
(cherry picked from commit 858b9e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 22, 2024
)

Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
(cherry picked from commit 858b9e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue May 22, 2024
…nGH-119099)

Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
(cherry picked from commit 858b9e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue May 22, 2024
…H-119389)

Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue May 22, 2024
…H-119390)

Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
pablogsal pushed a commit that referenced this issue May 23, 2024
…119393)

Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e8)
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
)

Fix regression introduced in pythongh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in pythongh-100884.
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

Successfully merging a pull request may close this issue.

2 participants