email blacklist (blocking) for EXIM
Linux   July 18, 2022

email blacklist (blocking) for EXIM

There are extensions, IPs, and domains from which a considerable amount of temporary or permanent spam is sent. In this article, we show you how to block a lot of spam by adjusting the configuration of Exim
Login to the server as root.

Create a new file:

# touch /etc/exim/eximblacklist
# vim /etc/exim/eximblacklist

You can add the problematic domain inside this file without quotes. Save the file after adding the domain(s).


Then we need to make some edits with the main Exim configuration file.

 # vim /etc/exim/exim.conf

Add the following line in the first session just below the line.

 # domainlist exim_blacklist = lsearch;/etc/eximblacklist

After that, add the following under 'Routers Configuration' section:

reject_domains:
driver = redirect
# RBL Blacklist incoming hosts
domains = +exim_blacklist
allow_fail
data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.

Save the file and then restart the Exim service:

 # sudo systemctl restart exim

If you are finding more domains doing the spamming activities, you can simply add the domain name to '/etc/exim/eximblacklist' and no further changes needed.