There are two sides to email blacklisting. On the one hand, there's the need to get your server off of common online blacklists. On the other, there's the need to manage email blacklists on the server so as to reduce spam.
Check out our 1)guide to getting removed from email blacklists via the KnownHost wiki.
One method of blacklisting is to block entire domains from sending you email is to create an eximblacklist file and then updating the Exim configuration to make use of that blacklist file.
Step 1 - SSH into the server and login as root Step 2 - Create a new file called eximblacklist in /etc with
nano /etc/eximblacklist
Step 3 - Add domains to be blocked in this file with one per line, like
somespammer.net otherspamdomain.com
Step 4 - Save and close the file
Step 1 - Edit the exim.conf that's in /etc/exim
nano /etc/exim/exim.conf
Step 2 - Look for the line with Exim 4 Config and add the following
domainlist exim_blacklist = lsearch;/etc/eximblacklist
Step 3 - Look for the line with Routers Configuration and add the following
reject_domains: driver = redirect # RBL Blacklist incoming hosts domains = +exim_blacklist allow_fail data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
Step 4 - Save and close the exim.conf file Step 5 - Restart exim
service exim restart
Step 1 - Login to WHM and in the search bar, search for Exim Step 2 - Click Exim Configuration Manager then Advanced Configuration Step 3 - Click Add Additional Configuration Step 4 - In the first text box add
domainlist exim_blacklist
Step 5 - In the second text box add
lsearch;/etc/eximblacklist
Step 6 - Look for the line with Routers Configuration section in the first subsection, Section: PREROUTERS, and add the following
reject_domains: driver = redirect # RBL Blacklist incoming hosts domains = +exim_blacklist allow_fail data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
Step 7 - Save and restart Exim
If you've got cPanel and would like to block spam for a particular domain, login to cPanel and follow these steps below.
There's more than one way to enter blacklist items in Step #5. You can block:
Individual Email Addresses
john@doe.com
Entire Domains
*@doe.com