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.
2. In exim.conf we add the following lines for ACL
deny senders = /etc/deny_senders
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:
4. We save the file and restart the EXIM service.
systemctl restart exim
The result in the server will look like this:
tail -f /var/log/exim.log
1eYSPn-0006oJ-2U H=(qq.com) [188.8.131.52] F=<[email protected]> rejected after DATA
1eYSQJ-0006ok-FN H=(aplongsheng.com) [184.108.40.206] F=<[email protected]> rejected after DATA
1eYSQU-0006pT-F6 H=(cdadsj.com) [220.127.116.11] F=<[email protected]> rejected after DATA
1eYSSQ-0006ux-QB H=(qq.com) [18.104.22.168] F=<[email protected]> rejected after DATA
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.