1

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.

example

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.

1 Answers1

0

Solved: The answer is that Gmail ISP blocks emails with emoji’s and graphical characters in the "friendly from" email field. The reason is to prevent any graphical characters that could be confused with UI elements.

I found the answer in this article: https://www.spamresource.com/2023/01/pro-tip-no-emojis-in-friendly-from.html

I fixed the issue by removing characters detected by this regex

/\p{So}/

Which I found in this other answer: How do I remove emoticons/emojis/special icons from a string?