Closed tylercollier closed 7 months ago
Thank you @tylercollier for the detailed explanation. We'll look into it and resolve it in one of the future releases.
@capuderg Great! May I ask for an ETA? The page I linked says that Google's deadline for bulk senders is February 1, 2024.
Requirements for sending 5,000 or more messages per day
Starting February 1, 2024, senders who send more than 5,000 messages per day to Gmail accounts must meet the requirements in this section. ... Marketing messages and subscribed messages must support one-click unsubscribe, and include a clearly visible unsubscribe link in the message body.
I'm hoping the change can happen ASAP so that I have time to deploy it and test. Thanks for the consideration!
Hi @tylercollier we plan to make a small lite release in the next few days.
Well that will teach me not to subscribe to version updates. I see a new version was cut the day of your last comment. I'll check it out tomorrow. Thanks!
I'm seeing this behavior in version WP Mail SMTP 3.0.3, 3.10.0, and 3.9.0. I'm using the Sendgrid provider.
Expected Behavior
There is a mail header called List-Unsubscribe. I learned about it due to Google/Yahoo's new requirements going into effect on February 1, 2024. The value requires it to be wrapped with angle brackets.
So, if I use a header like this:
The value should not be removed.
Current Behavior
The value is being filtered/removed. It ends up blank, like this:
If I use multiple values (allowed), separated by commas, like this:
it ends up like this:
Note the remaining comma. But everything between angle brackets has been removed.
Possible Solution
WP Mail SMTP uses
WP::sanitize_value()
inset_body_header()
, which removes all tags with its call towp_strip_all_tags()
. It obviously doesn't do this for all headers, as myFrom
andReply-To
headers use angle brackets and they're not filtered in this way. But I tried another custom header, which I calledX-Proof
, and it exhibited the same behavior asList-Unsubscribe
. So a possible solution is to relax the filter for this single special header.Steps to Reproduce