How can we block receiving emails from a specific domain name [EXIM TIPS]

Many e-mail servers have encountered a massive spam spam received from e-mail addresses in China.
To filter IPs is quite difficult, especially if they are a few thousand and are not included in a global SPAM list. I have seen, however, that many messages come from qq.com. A domain address that uses a lot of IPs and makes SPAM globally.

If we identify the source domain from which these messages are sent and we have access to the EXIM service configurations, you can set an automatic rejection of them. This means that messages sent from a specific domain name or e-mail address can be automatically rejected.

How do we set EXIM to automatically reject incoming messages from one or more domain names, email addresses, or even TLDs (.cn, .in, .io, etc ...)

First of all we need to have full access to the e-mail server and let us know that e-mail is being transported through the EXIM service. This is also the most widely used on Linux servers.

1. Locate and open for editing "exim.conf". The name may vary depending on the EXIM version used.

nano /etc/exim.conf

2. In exim.conf we add the following lines for ACL

acl_check_data:
deny senders = /etc/deny_senders
accept

We save the file after adding the lines above.

3. We create and edit the "deny_senders" file by adding domains, email addresses, or .tlds from which we do not want to receive emails: nano /etc/deny_senders

It's the easiest simple option if you're taken up by waves of SPAM coming from China, India, Russia or other areas of the globe. However, before blocking a domain name or a TLD, make sure you do not have partners or collaborators who can contact you from these addresses.

This EXIM setup is valid for both web servers with cPanel and for those with VestaCP.

How can we block receiving emails from a specific domain name [EXIM TIPS]

About the author

Stealth

Passionate about everything that means gadgets and IT, I write with pleasure stealthsettings.com from 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

Translate in your language ...

This site uses local cookies to give you a good online experience and cookies from Google and third partners for traffic and advertising analysis. Find out what cookies are used, what it is used for, and how you can turn it off by following the "Cookies policy" link. I understand!Cookies Policy