[wp-trac] [WordPress Trac] #62940: wp_mail(): Address header parsing is not RFC-5322 complient and fails on quoted-string when including a "<", ">" or ", "
WordPress Trac
noreply at wordpress.org
Thu Aug 21 12:29:59 UTC 2025
#62940: wp_mail(): Address header parsing is not RFC-5322 complient and fails on
quoted-string when including a "<", ">" or ","
-------------------------------------------------+-------------------------
Reporter: bhujagendra | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Mail | Version: 2.1.1
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests has- | Focuses:
test-info |
-------------------------------------------------+-------------------------
Comment (by SirLouen):
@jdeep you mean for the whole parsing part using the PHPMailer static
method?
Many of the these functions were implemented, overlapping PHPMailer, for
many reasons (mostly because they were implemented actually before even
they existed in PHPMailer, like the case of `parseAddresses`). In fact
most of `wp_mail` is just a reimplementation of almost the whole
`PHPMailer` API. This provides some degree of easiness to migrate in case
PHPMailer happens to derail at some point. Nowadays I would rather choose
to extend PHPMailer, rather than rewrite the same code, and definitely
never inherit anything.
The `parseAddresses` from PHPMailer implements both options, with the
`imap` PHP Extension, and without it. It's not a bad idea to simply
replace everything with this ngl, especially since we are already mostly
depending on PHPMailer atm, instead of implementing a full parsing flawed
logic as we are currently doing.
> I feel this is much suited to be implemented properly
I don't understand this: Why do you think [https://github.com/WordPress
/wordpress-develop/blob/d71f29ff0899c6eb29bc037a7c521a966405cb35/src/wp-
includes/PHPMailer/PHPMailer.php#L1257 its not implemented propertly
here]?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62940#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list