GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — email: address list folding encodes list-separator comma · Issue #100884 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
#100885
Closed
email: address list folding encodes list-separator comma#100884
#100885
Copy link
Labels
topic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@t-8ch
t-8ch
opened on Jan 9, 2023
Issue body actions

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, ä <[email protected]>'
>>> m['to'] = t
>>> m.as_string()
'to: 01234567890123456789012345678901234567890123456789012345678901@example.org\n =?utf-8?q?=2C?= =?utf-8?q?=C3=A4?= <[email protected]>\n\n'

Your environment

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

Linked PRs

  • GH-100884: email/_header_value_parser: don't encode list separators #100885
  • [3.12] gh-100884: email/_header_value_parser: don't encode list separators (GH-100885) #115592
  • [3.11] gh-100884: email/_header_value_parser: don't encode list separators (GH-100885) #115593

Activity

  1. t-8ch
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jan 9, 2023
  2. t-8ch
    added 3 commits that reference this issue on Jan 9, 2023

    pythonGH-100884: email/_header_value_parser: use existing ListSeparator

    b1f41b8

    pythonGH-100884: email/_header_value_parser: don't encode list separa…

    98ab61d

    pythonGH-100884: email/_header_value_parser: don't encode list separa…

    75a89ca
  3. mdboom
    added
    topic-email
    on Jan 9, 2023
  4. mricon
    added a commit that references this issue on Jan 9, 2023

    tests: add another test for very long email address

    26e7d3c
  5. serhiy-storchaka
    closed this as completedin #100885on Feb 17, 2024
  6. serhiy-storchaka
    added a commit that references this issue on Feb 17, 2024

    gh-100884: email/_header_value_parser: don't encode list separators (G…

    09fab93
  7. miss-islington
    added 2 commits that reference this issue on Feb 17, 2024

    pythongh-100884: email/_header_value_parser: don't encode list separa…

    5f617f2

    pythongh-100884: email/_header_value_parser: don't encode list separa…

    a2640a5
  8. serhiy-storchaka
    added 2 commits that reference this issue on Feb 17, 2024

    [3.12] gh-100884: email/_header_value_parser: don't encode list separ…

    9148b77

    [3.11] gh-100884: email/_header_value_parser: don't encode list separ…

    70754d2
  9. woodruffw
    added a commit that references this issue on Mar 4, 2024

    pythongh-100884: email/_header_value_parser: don't encode list separa…

    90daba0
  10. diegorusso
    added a commit that references this issue on Apr 17, 2024

    pythongh-100884: email/_header_value_parser: don't encode list separa…

    8b88128
  11. serhiy-storchaka
    added 3 commits that reference this issue on May 16, 2024

    pythongh-118643: Fix AttributeError in the email module

    af3ced0

    pythongh-118643: Fix AttributeError in the email module

    ad85b83

    gh-118643: Fix AttributeError in the email module (GH-119099)

    858b9e8
  12. miss-islington
    added 2 commits that reference this issue on May 22, 2024

    pythongh-118643: Fix AttributeError in the email module (pythonGH-119099

    6d4b54f

    pythongh-118643: Fix AttributeError in the email module (pythonGH-119099

    d111cba
  13. serhiy-storchaka
    added 3 commits that reference this issue on May 22, 2024

    [3.11] pythongh-118643: Fix AttributeError in the email module (pytho…

    9bfb6ae

    [3.13] gh-118643: Fix AttributeError in the email module (GH-119099) (G…

    6892b40

    [3.12] gh-118643: Fix AttributeError in the email module (GH-119099) (G…

    8c96850
  14. pablogsal
    added a commit that references this issue on May 23, 2024

    [3.11] gh-118643: Fix AttributeError in the email module (GH-119099) (#…

    4762b36
  15. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-118643: Fix AttributeError in the email module (pythonGH-119099

    c068bee
  16. LukasWoodtli
    added a commit that references this issue on Jan 22, 2025

    pythongh-100884: email/_header_value_parser: don't encode list separa…

    f306be6
  17. mcepl commented on Mar 11, 2025

    @mcepl
    mcepl
    on Mar 11, 2025
    Contributor
    More actions

    Shouldn’t CVE-2025-1795 be mentioned here?

    Reacted by Anthony Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.