Skip to content

Fix #80751: Comma in recipient name breaks email delivery #6735

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

Closed
wants to merge 5 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Feb 26, 2021

So far, SendText() simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses. We fix that by introducing an own variant of
strtok_r() which caters to quoted-strings.

We also make FormatEmailAddress() aware of quoted strings.

We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.

So far, `SendText()` simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses.  We fix that by introducing an own variant of
`strtok_r()` which caters to quoted-strings.

We also make `FormatEmailAddress()` aware of quoted strings.

We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.
@cmb69 cmb69 added the Bug label Feb 26, 2021
That is an invalid email address, but we must not read beyond the
string.  Other than bailing out, we do not especially handle that case,
but let the SMTP figure that out as usual.
cmb69 and others added 2 commits March 1, 2021 16:19
@php-pulls php-pulls closed this in 71297a2 Mar 1, 2021
@cmb69 cmb69 deleted the cmb/80751 branch March 1, 2021 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants