How to manually block/reject emails from domain in Exim ?

How to manually block/reject emails from domain in Exim ?

Do you have spam mails problem? If you are getting spam mails from a particular domain then you can easily block those annoying spam mails on your Exim mail server. But it only works for the companies who are sending spam mails from a particular domain, if the spam mails are sending from Gmail or hotmail then it won’t work. In this article you can find detailed information about blocking mails from domain.

1. First you have to create a Exim blacklist file in /etc/Eximblacklist and enter the domain name which you want to black list with following command:

  • First login as a root on your server.
  • Enter the command to create a new file :
Code:
Nano /etc/Eximblacklist
  • In this file you can enter those domain names which you want to block.
Code:
domainblock.com etc
2. Now you have to configure the Exim so that it can check the blacklist file and block the mails according to list. Let’s see how to configure Exim in WHM :

  • Login to WHM and search “Exim”.
  • Click on “Exim Configuration Manager” under Advanced Configuration tab.
exim.png


  • Here click on “Add additional configuration setting” and two textboxes will appear. In first box you have to enter the code “domainlist Exim_blacklist” and in second box “lsearch;/etc/Exim_blacklist”.
exim2.png


  • In the domain configuration section add the following code :
Code:
reject_domains:
driver = redirect
# RBL Blacklist incoming hosts
domains = +Exim_blacklist
allow_fail
data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
3. At last click on save button and restart your Exim.
Author
Bhawani Singh
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Bhawani Singh

Top