Block receiving emails from specific domain to any mailing list?

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter

keat63

Well-Known Member
Nov 20, 2014
1,916
263
113
cPanel Access Level
Root Administrator
I performed something similar two weeks ago.
There are instructions out there, but the ones I found were not particularly idiot proof, so i wrote these for my own reference just in case I have to do it again.
These instructions will allow you to stop any unwanted domains from emailing anything on your server.



Creating an Exim Blacklist

First create your blacklist.
Inside the etc folder create a new file called “exim_blacklist”
On a separate line, add the domains you wish to block. (one domain per line)
This could be achieved by creating a standard text file on your computer, ftp it to the etc folder then remove the .txt extension.



Go to WHM >> EXIM CONFIGURATION MANAGER >>

Backup your current exim config before you start. Any errors in here could render EXIM useless.

Did you make that backup ?.. No, then do it now.

Next choose the Advanced Editor tab, and scroll down to the Add Additional Configuration Settings button. (about 1/3rd of the way down the page)

Click the + sign to add another entry, and choose “domainlist [LISTNAME]” from the drop down.
Over write [LISTNAME], with exim_blacklist and in the box opposite add: lsearch;/etc/exim_blacklist

It should say: domainlist exim_blacklist = lsearch;/etc/exim_blacklist
Click the green tick

In the Routers Configuration section you add the following 6 lines:

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

I added this to the “ROUTEREND” box.
Click the green tick

Save your config.
Restart Exim.

If you need to blacklist more domains, edit the exim_blacklist file.
 
Last edited:

Eltawoos

Member
Apr 19, 2014
15
0
1
Cairo
cPanel Access Level
Root Administrator
I performed something similar two weeks ago.
There are instructions out there, but the ones I found were not particularly idiot proof, so i wrote these for my own reference just in case I have to do it again.



Creating an Exim Blacklist

First create your blacklist.
Inside the etc folder create a new file called “exim_blacklist”
On a separate line, add the domains you wish to block. (one domain per line)
This could be achieved by creating a standard text file on your computer, ftp it to the etc folder then remove the .txt extension.



Go to WHM >> EXIM CONFIGURATION MANAGER >>

Backup your current exim config before you start. Any errors in here could render EXIM useless.

Did you make that backup ?.. No, then do it now.

Next choose the Advanced Editor tab, and scroll down to the Add Additional Configuration Settings button. (about 1/3rd of the way down the page)

Click the + sign to add another entry, and choose “domainlist [LISTNAME]” from the drop down.
Over write [LISTNAME], with exim_blacklist and in the box opposite add: lsearch;/etc/exim_blacklist

It should say: domainlist exim_blacklist = lsearch;/etc/exim_blacklist
Click the green tick

In the Routers Configuration section you add the following 6 lines:

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

I added this to the “ROUTEREND” box.
Click the green tick

Save your config.
Restart Exim.

If you need to blacklist more domains, edit the exim_blacklist file.

Thanks a lot, but a asked about manage it on the "mailing list", (Big number of emails)