You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can I block an entire email domain?

I’m getting lots of spam that uses a random number in the email address, making it impossible to block them all. Is there a way to block all email from a given domain? (eg “*@wish.com” would be the Windows equivalent) Thanks!

Posted on Nov 25, 2022 6:29 AM

Reply
7 replies

Nov 25, 2022 10:01 AM in response to SML Bill

Every email that you receive is sent from a Mail server which writes its address in the header Return-Path field. It may be, and often is, different than the email and domain name shown in the From header field. If you block on the domain name in that Return-Path header item, you shutdown different mail campaigns from anyone using that Mail server, and no longer need to consider the From header address.


Launch the Mail application, and just select one of the emails that you want to block. While that message remains selected, go to Mail > Settings… > Rules. Add a Rule. Name is No Spam, or any other meaningful name.


By default, it will have this layout:


If [ any ] of the following conditions are met:


[ From ] [ contains ] ___________


and [ move message ] to mailbox: [ No mailbox selected ]


You want to add a new Mail Header item to substitute for [ From ]. Click on the From selector and at the very bottom of that long menu of items, you will see Edit Header List… Click that and add [+] Return-Path exactly in this case. Once you do that, you can replace [ From ] with [ Return-Path ] as it is near the top of that selection menu:



When you enter [ Return-Path ] [ contains ] the rightmost _________ will automatically populate with the Return-Path header string for the current email message selection. This usually is some account on a mail server so it may have a bunch of content, perhaps even including your email address. Using your arrow keys, go the the very end of that header address string that ends in >. Start there and backspace (delete) characters until you get to some domain name. You do not care about the user name, or a sub-domain (spamsrc.bombard.ru), just the bombard.ru, or whatever that basic domain name is. Then you remove everything prior to it including the beginning < symbol.


So here is an example of a typical, but fictitious Return-Path header from a SPAM source:


<msprvs1=19327OI-fC709=bounces-299359-4@email.spamcentral.com>


You would remove everthing except spamcentral.com. In real life, there may as much content after that domain name as before it so your arrow key and back spacing will be busy.


The action in my Mail rule is [ Move Message ] to mailbox: [ Junk ] for your appropriate email account. It could also be [ Trash ].


When you save this rule, it wants to know if you want the rule applied to your selected SPAM message. If you agree, it is applied to the selection with the action you specified. Future emails with that same Return-Path header string will be immediately acted upon per the rule and you will not receive any dialog from Mail asking for your permission.


Nov 25, 2022 11:48 AM in response to SML Bill

Is this your iCloud email account that you're referring to? If so you can go to iCloud.com, sign into your email account and under Mail's settings select Rules. Then add the Rule to Mark the Email as Read and move to the Trash. I had the same wish.com today so created a rule on line to trash all email from wish.com. Did the same ro emails from Russia, .ru.


Nov 25, 2022 7:21 AM in response to SML Bill

Does the users' e-mail account Provider provided such a Flagging / Filtering Option / Blocking feature ?


Some ISP do this and must be configured while Logged into the ISP Web Interface to achieve this.


A lot easier than developing / constructing an Apple Mail Rule plus it would be captured and blocked it before it even makes it to your Inbox.

Can I block an entire email domain?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.