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

Postmark: Fix inbound ValueError with long, non-ASCII name #413

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

medmunds
Copy link
Contributor

Receiving a Postmark inbound message with a long From or recipient Name field could result in "ValueError: Header values may not contain linefeed or carriage return characters" if the name included non-ASCII characters.

Anymail's EmailAddress calls Django's sanitize_address(), which can introduce folding whitespace, causing an error in the AnymailInboundMessage constructor. Only Postmark inbound is affected, as no other webhooks construct an EmailAddress.

(Longer-term, Anymail should stop using the undocumented Django sanitize_address.)

Receiving a Postmark inbound message with a long From or recipient Name field could result
in "ValueError: Header values may not contain linefeed or carriage return characters" if
the name included non-ASCII characters.

Anymail's EmailAddress calls Django's sanitize_address(), which can introduce folding
whitespace, causing an error in the AnymailInboundMessage constructor. Only Postmark inbound
is affected, as no other webhooks construct an EmailAddress.

(Longer-term, Anymail should stop using the undocumented Django sanitize_address.)
@medmunds medmunds merged commit 5987e83 into main Dec 11, 2024
49 checks passed
@medmunds medmunds deleted the fix/postmark-inbound-address branch December 11, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant