Skip to content

MimePart: fixed not escaped header before encoded into utf-8#102

Merged
dg merged 1 commit into
nette:masterfrom
Daaarkling:fix-escaping
Apr 23, 2026
Merged

MimePart: fixed not escaped header before encoded into utf-8#102
dg merged 1 commit into
nette:masterfrom
Daaarkling:fix-escaping

Conversation

@Daaarkling
Copy link
Copy Markdown
Contributor

@Daaarkling Daaarkling commented Oct 10, 2024

  • bug fix
  • BC break? no

Headers containing special characters such as Czech characters also need to be escaped before converting to utf-8.

Example header From: Kdo uteče, obědvá <doe@example.com>

When google processes the email, it misparses the comma and because of that the DKIM signature verification fails and the email is rejected.

@dg dg force-pushed the master branch 4 times, most recently from af1d65e to 93bc1c9 Compare December 30, 2025 00:48
@dg dg force-pushed the master branch 2 times, most recently from 5aeaf1e to 82f31ef Compare February 10, 2026 02:48
@dg dg force-pushed the master branch 5 times, most recently from e5578f0 to e220d35 Compare February 24, 2026 16:12
@dg dg force-pushed the master branch 10 times, most recently from d266800 to 189277a Compare March 31, 2026 17:42
@dg dg force-pushed the master branch 2 times, most recently from d356e6e to 211bd8c Compare April 23, 2026 21:06
@dg dg merged commit af13a00 into nette:master Apr 23, 2026
dg pushed a commit that referenced this pull request Apr 23, 2026
…ncoding (#102)

When a name in From/To/Cc contained characters outside RFC 2822 atext
(e.g. comma or quote in a UTF-8 name), it was base64-encoded as-is. After
the recipient decoded it, the raw special chars reappeared in the phrase
and could be misparsed (a comma would split one address into two).

Wrap such phrases in quoted-string before encoding, so the decoded form
is a valid quoted phrase. Applies only to the phrase part of address
headers, not to Content-Disposition filename values.
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

Successfully merging this pull request may close these issues.

2 participants