Gmail is ISP blocking emails I am sending and giving this error message:
smtp;550 5.7.1 The message contains a unicode character in a disallowed header. Please visit https://support.google.com/mail/?p=BlockedMessage to review our message and header content guidelines.
The pattern with this error response is that the emails always contain non-alphanumeric characters in the From
and Subject
headers. However there are many emails with non-ascii characters in these headers that are still being allowed through.
Here is an example of the raw headers from a rejected email:
From: =?utf-8?b?U2ViYXN0aWFu8J+luuKclPCfpbA=?= "(xxxxx)"
<notifications@xxxxx.com>
Date: Fri, 24 Feb 2023 14:58:35 -0500
Subject: =?utf-8?b?8J+SmeKZpfCShpwg8J2TkvCdk7HwnZOq8J2TvSDwkoac4pml8J+SmQ==?=
The error message Gmail responds with is too vague though, what exactly is the problem? Is it the encoding? Is it that I can't include unicode characters in both headers?
I have tried changing the encoding of the headers with no success. I could of course just ensure the headers contain only ascii characters but that is not ideal.