For days I have been trying to work out how to do this with WHM. For some reason methods which should work and do work for others just don't for me.
So far I have found two solutions that do work.
/http://forum.ahosting.net/f15/how-manually-block-reject-emails-domain-exim-662.html
You need ssh access ideally to create and edit the blacklist file. It worked straight away with no fuss and no mess. Senders from those domains are rejected with a permanent fail but your normal sender verify errors or similar are also sent as it is further down in the exim process.
If you follow the first step of that method you can also use the ACL to block those senders earlier in the process then:
Scroll down to the acl_smtp_mail and find the custom_begin_mail section. Tick it and stick this in:
exim_blacklist is the name you gave your blacklist file which is set in the ACL as shown in the link.
For some reason if you do the same with a normal domain list instead of the filename of a domain list it just doesn't work and exim blocks all mail with the same error. I spent ages fiddling around and couldn't get it to the same with a list in the ACL itself rather than referencing the list object created previously. I do not understand why this is the case. I'm assuming it is some kind of bug or delimiter issues as it makes no rational sense for it to work perfectly well with the same domains listed in a file and not work when make a list within the ACL section itself. Maybe some exim guru can explain why this is the case? WHM doesn't flag it up as a syntactic error either so there is no way of knowing why this doesn't appear to work as you'd expect.
I hope this helps others as it is such a useful thing to be able to do and something as a previous plesk user it is achieved in plesk in about 2 minutes as that has a server wide blacklist that takes domains, ips or wildcarded domains.
There's some very useful stuff in this link too:
/http://technotes.trostfamily.org/?p=184
Building a Poor Man’s Barracuda – cPanel edition - Tech Notes
So far I have found two solutions that do work.
/http://forum.ahosting.net/f15/how-manually-block-reject-emails-domain-exim-662.html
You need ssh access ideally to create and edit the blacklist file. It worked straight away with no fuss and no mess. Senders from those domains are rejected with a permanent fail but your normal sender verify errors or similar are also sent as it is further down in the exim process.
If you follow the first step of that method you can also use the ACL to block those senders earlier in the process then:
Scroll down to the acl_smtp_mail and find the custom_begin_mail section. Tick it and stick this in:
deny sender_domains = +exim_blacklist
message = $domain is manually blacklisted in ACL.exim_blacklist is the name you gave your blacklist file which is set in the ACL as shown in the link.
For some reason if you do the same with a normal domain list instead of the filename of a domain list it just doesn't work and exim blocks all mail with the same error. I spent ages fiddling around and couldn't get it to the same with a list in the ACL itself rather than referencing the list object created previously. I do not understand why this is the case. I'm assuming it is some kind of bug or delimiter issues as it makes no rational sense for it to work perfectly well with the same domains listed in a file and not work when make a list within the ACL section itself. Maybe some exim guru can explain why this is the case? WHM doesn't flag it up as a syntactic error either so there is no way of knowing why this doesn't appear to work as you'd expect.
I hope this helps others as it is such a useful thing to be able to do and something as a previous plesk user it is achieved in plesk in about 2 minutes as that has a server wide blacklist that takes domains, ips or wildcarded domains.
There's some very useful stuff in this link too:
/http://technotes.trostfamily.org/?p=184
Building a Poor Man’s Barracuda – cPanel edition - Tech Notes