You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mail: subjects with a few accented characters are sent blank (lib/PHPMailer 5.1) #523
Branch: dev-5.0.0 (fixed on dev-6.0.0, which uses phpmailer/phpmailer ^7.1 from Composer)
What happens
Outgoing mail whose subject (or any encoded header) is mostly ASCII but contains a few non-ASCII characters goes out with an empty value. For example, the subject Ümlaut Corp is sent as:
Subject: =?utf-8?Q??=
Strings that are mostly non-ASCII switch to Base64 (B) encoding and survive, e.g. Société Générale Équipe → =?utf-8?B?U29jacOp…?=.
Cause lib/PHPMailer/class.phpmailer.php (5.1, 2009), EncodeQ() around line 1735, uses preg_replace() with the /e modifier, which was removed in PHP 7. The call fails with a warning and returns an empty string, so the Q-encoded word is empty.
Also logs: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead.
Impact
Every notification (tasks, events, forums, password reset…) whose project, task or company name has an accented character arrives with no subject. This hits most Latin-script languages (German, French, Spanish, etc.), where a name usually has only a few accented characters.
Fix options
Back-port the dev-6.0.0 change: require phpmailer/phpmailer ^7.1 and have w2p_Utilities_Mail extend \PHPMailer\PHPMailer\PHPMailer (also closes the known CVEs in 5.1). Medium effort; test SMTP, mail(), queued mail and password resets.
Minimal patch in lib: replace the /e call in EncodeQ() with preg_replace_callback(). Small effort, but it edits vendored code and leaves the other 5.1 issues.
If option 2 is the route, note that EncodeQ() has three /e calls, not one: lines 1727 (phrase), 1730 (comment) and 1735 (text/default). The phrase branch is the one AddrFormat() uses for display names (line 918, EncodeHeader(..., 'phrase')), so a From/To name like Zoë Müller is probably affected the same way as the subject. Patching only the default branch would leave that broken.
A minimal replacement that keeps the same output for all three:
The comment case falls through into text in the original too, so I kept that. I haven't run this against the full mail flow, so it would be worth checking a name with an accent in a task notification as well as the subject.
Activity
Mail: Q-encode headers without preg_replace()'s removed /e modifier
kabeer7121 commentedon Nov 3, 2026
If option 2 is the route, note that
EncodeQ()has three/ecalls, not one: lines 1727 (phrase), 1730 (comment) and 1735 (text/default). Thephrasebranch is the oneAddrFormat()uses for display names (line 918,EncodeHeader(..., 'phrase')), so a From/To name likeZoë Mülleris probably affected the same way as the subject. Patching only the default branch would leave that broken.A minimal replacement that keeps the same output for all three:
The
commentcase falls through intotextin the original too, so I kept that. I haven't run this against the full mail flow, so it would be worth checking a name with an accent in a task notification as well as the subject.caseysoftware commentedon Nov 3, 2026
Thanks for the callout. This one is already resolved in 5aa85b5 and this one will be closed when dev-5.0.0 is merged into master.