To block these messages, a custom filter rule with a regex match can be used. For instance, to block any mail from anyone named "John Doe" unless their email address was
then this regex pattern could be used:
This would allow mail from:
"John Doe" <John@example.com>
But not from these:
"John Doe" <John@spammersRus.com>
"John Doe" <fake@phishingTrickster.com>
"John Doe" <John@someoneWithTheSameName.com>
This only works if you don't plan on receiving mail from anyone with the name John Doe except from
When using a single email address, the custom filter rule would look like this in the control panel:
If you only need to allow a single email address for a given display name, the above is all you need to do. For more complex situations, the additional examples below may be helpful.
Allowing multiple email addresses or an entire domain
Here's an example that allows mail from a local address and an external address:
To allow an entire domain, it would look like this:
Or, a combination of an entire domain and external email addresses:
If you are converting a previous rule that only allowed a single email address or domain, see these additional examples that illustrate what needs to change: example
And this example allows anything from the local domain or two external email addresses:
The highlights show what was
from the single-address example.
- The search is case insensitive
- The syntax is very important here so be sure to follow it closely and test it afterward.
- This won't block all display name spoofing, but can help eliminate the problem in many cases.