After more monitoring I think it may be doing what it's supposed to. Seeing either "Connection refused" or "Connection timed out" or "lost" on the filtered tlds using grep -F '.tk [' /var/log/exim_mainlog. Maybe it works after all
I am using the "
make a backup copy first and then rename root/etc/cpanel_exim_system_file to cpanel_exim_system_file_custom method. Be sure to change it in your WHM under "Service Configuration > Exim Configuration Manager > Filters" under System Filter File and add the code to the end of the file.
WARNING! This will affect all email accounts on your email server. I highly recommend tracking your filters to a separate account to check for false positives. To see if you have made a misteak

open your WHM to " Email > Mail Queue Manager" and run a report. If there are any messages in the queue, try to send one and it will tell you the line number of the broken rule in your cpanel_exim_system_file_custom file.
I have been playing with this for several weeks now and this is the best syntax so far....
Code:
#Block Palau (Spammers use this a lot)
if first_delivery
and ("$h_from:" matches " [email protected]+\.pw")
then
headers add "SpamRule: EXIM FILTER Block Palau (was: $h_subject:)"
deliver "Global Spam <[email protected]>"
seen finish
endif
The "headers_add" adds a new header to the email so I can track the rule name and the "deliver" sends the email to an account so I can check for false positives.
I am also blocking the most spam on my server with:
Code:
#NEW Block Europe rule
#Block Europe using new syntax [email protected]+\.eu
if first_delivery
and ("$h_from:" matches " [email protected]+\.eu")
or ("$h_to:" matches " [email protected]+\.eu")
then
headers add "SpamRule: EXIM FILTER Block Europe New Syntax (was: $h_subject:)"
deliver "Global Spam <[email protected]>"
seen finish
endif
Hope this helps.
PS
I have been having trouble blocking Argentina spam, ("ar" is very common), and I am trying a new syntax that seems to be working so far. I got it from Phillip Hazel's EXIM manual.
Code:
#Block Argentina
if first_delivery
and $h_from matches " \\N\\.ar$\\N"
then
headers add "SpamRule: EXIM FILTER Block Argentina (was: $h_subject:)"
deliver "Global Spam <[email protected]>"
seen finish
endif
So far it has not produced any false positives but I am keeping my eye on it.
