How to block a mail from particular domain
To block a mail from a particular domain, you can use various methods depending on your email client or server. Here are some common ways to do so:
Method 1: Using a Spam Filter
If you're using a spam filter like SpamAssassin, SpamFilter, or SpamSieve, you can add the domain to the filter's blocklist. This will prevent emails from that domain from reaching your inbox.
Method 2: Using a Mail Client (e.g., Outlook, Thunderbird)
- Open your email client and go to the settings or options menu.
- Look for the "Filters" or "Rules" section and click on it.
- Create a new filter or rule with the following conditions:
- "From" or "Sender" contains the domain you want to block (e.g., @example.com).
- Set the action to "Delete" or "Move to Junk" or "Block".
- Save the filter or rule.
Method 3: Using a Mail Server (e.g., Postfix, Exim, Sendmail)
- Edit your mail server's configuration file (e.g.,
/etc/postfix/main.cf
for Postfix). - Add the following lines to the file:
smtpd_recipient_restrictions = check_recipient_access pcre:/etc/postfix/recipient_access
recipient_access = pcre:/etc/postfix/recipient_access
- Create a new file
/etc/postfix/recipient_access
with the following content:@example.com REJECT
- Save the file and restart your mail server.
Method 4: Using a DNS Blackhole
You can also use a DNS blackhole to block emails from a particular domain. This method requires modifying your DNS settings.
- Create a new DNS record with the following settings:
- Type: TXT
- Name:
_mail.example.com
(replaceexample.com
with the domain you want to block) - Value:
v=spf1 -all
- This will create a blackhole for emails sent from the specified domain.
Method 5: Using a Third-Party Service
There are also third-party services like Spamhaus, SORBS, and SpamFilter that allow you to block emails from specific domains. You can add the domain to their blocklist, and they will prevent emails from that domain from reaching your inbox.
Remember to always verify the authenticity of the emails you receive, even if you've blocked a domain.