Filter trickery.
Unlike other email services, Gmail doesn’t make it easy to block all email from a specific domain. You can easily block individual email addresses, but blocking an entire domain is not obvious.
That doesn’t mean you can’t do it. I’ll show you how.
Become a Patron of Ask Leo! and go ad-free!
Blocking email from a specific domain
To block an entire domain in Gmail, you can use a filter trick: search for “from:(@domain)”, open the advanced search, and create a filter to delete emails from that domain. If needed, you can edit or delete the filter in settings later.
All email from a domain
Let’s define what we mean first. The “domain” is that part of an email address after the “@”. So in “leo@askleo.com”, the domain is askleo.com. For “example@gmail.com” it’s gmail.com.
Blocking all email from a domain means that no email from any email address on that domain will get to you. Blocking all email from gmail.com, for example, will prevent anyone with a Gmail address from reaching you.
While that’s likely not what you want, there are scenarios — typically spam-related — where blocking an entire domain makes sense. If you’re being flooded with email from some obscure email domain, particularly from another country, there may be no downside to blocking them all. The upside, of course, would be a tamer inbox.
A Gmail filter trick
It’s not really a trick; it’s just not obvious.
With email from the domain you’re considering blocking in your inbox, search for “from:(@domain)”. So if you’re getting a flood of email from “someone@randomisp.com”, search for “from:(@randomisp.com)” as shown below.
Double-check the results. Make sure you’re:
- Seeing the email you want to block and
- Not seeing any email you want to keep.
Once you’re satisfied, click on the sliders icon at the end of the search field.
This will open up the advanced search dialog.
While you can make adjustments here, you don’t need to. It’s pre-filled with the search we just performed.
Click on Create filter at the bottom.
This lists actions to be taken when incoming mail matches your search criteria. I’ve selected “Delete it” as there’s no “Mark as spam” option.
Click on Create filter and your filter will take effect on any subsequently received email.
Removing or editing a filter
Click on the gear icon at the upper right of the Gmail screen and then on See all settings. Click on the Filters and Blocked Addresses tab.
To the far right (not shown) are edit and delete buttons. Click edit to make changes or delete to remove the filter completely.
Do this
While “Mark as spam” is probably the most-used approach to dealing with spam, if you’re getting too much email from different addresses on the same domain, you can now block (automatically delete) all email from that domain.
Don’t block me! Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.
You said there’s no “Mark as spam” option. Couldn’t you mark it as Spam by applying the spam label by ticking the
Apply the label: Choose label box?
For those who don’t know how Gmail uses labels insead of folders see
How Do Gmail Labels Relate to Folders?
This post reminded me that we (both my wife and I) have a related problem: most gmail receipients of our personal emails do not receive them, and we get notices from Microsoft that that they were not deliverable. This has not occurred with other email recipients. Is there some default setting that causes this problem? We are routinely frustrated by this frequent issue.
The undeliverable message should have included a reason. Could be many things.
Can I do this in Outlook, web?
I believe so. Settings -> Junk email -> Senders -> Blocked senders and domains.