fix(mime): Q-encode RFC822 specials in header words - #76
Closed
tobias-weiss-ai-xr wants to merge 1 commit into
Closed
tobias-weiss-ai-xr wants to merge 1 commit into
tobias-weiss-ai-xr wants to merge 1 commit into
Conversation
Display names such as 'Surname, Firstname [Org]' (a common collected-address convention) were Q-encoded as '=?utf-8?q?Surname=2C_Firstname_[Org]?=' - the comma forces the encode path, but '[' and ']' stayed literal bytes inside the encoded word. Dovecot's rfc822 parser treats that literal '[' as a domain-literal opening, never reaches the real <addr> and fabricates a recipient with its MISSING_DOMAIN fallback (mailbox truncated at '[', host lost). SOGo then renders the Dovecot envelope verbatim, e.g. To: 'Surname, Firstname @MISSING_DOMAIN'. Exclude the full RFC 822 specials set (( ) < > [ ] \ . , ; : @ ") from 'printable' so Q-encoding escapes them (=5B/=5D etc.). Verified: 'Surname, Firstname [Org]' now encodes to the round-trip-safe '=?utf-8?q?Surname=2C_Firstname_=5BOrg=5D?=' which Dovecot parses with correct mailbox host.
tobias-weiss-ai-xr
force-pushed
the
fix/encodeAddressBrackets
branch
from
September 15, 2026 13:39
c466731 to
04bd241
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Display names such as 'Surname, Firstname [Org]' (Surname, Firstname [Org], common in collected-address book entries) were Q-encoded as '=?utf-8?q?Firstname=2C_Lastname_[Org]?=' - the comma forces the encode path, but '[' and ']' stayed literal bytes inside the encoded word.
Dovecot's rfc822 parser treats that literal '[' as a domain-literal opening, never reaches the real and fabricates a recipient with its MISSING_DOMAIN fallback (mailbox truncated at '[', host lost). SOGo then renders the Dovecot envelope verbatim, e.g. To: 'Surname, Firstname @MISSING_DOMAIN'.
Exclude the full RFC 822 specials set (( ) < > [ ] \ . , ; : @ ") from 'printable' so Q-encoding escapes them (=5B/=5D=40 etc.).