bypass rules in /etc/cpanel_exim_system_filter for certain domain or whitelist

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
I have many body and header filter for spammers in /etc/cpanel_exim_system_filter. I want to be able to write a file called /etc/whitedomainlist and any domain is in this file will bypass /etc/cpanel_exim_system_filter. I don't want to use spamassain or greylist to do that. I tried this - Removed - but it doesn't work on my server maybe because exim version or cpanel version too old.

thanks for help much appriciated.
 
Last edited by a moderator:

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
I want to add exclusion domains just before spam filter starts If anything comes from gmail.com or cpanel.net bypass spamfilter rules. whitelist code below doesn't work

# whitelist start
if
$header_from: does not end "gmail.com"
or $header_from: does not end "cpanel.net"
then
# whitelist finish


# SPAM FILTER START
# Header Spam
$header_subject: contains "Pharmaceutical"
or $header_subject: contains "Viagra"
# Body Spam
or $message_body: contains "Pharmaceutical"
or $message_body: contains "website audit"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered."
seen finish
endif
# SPAM FILTER FINISHED
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
Thank you for your help. I have looked up links you gave me but I couldn't find specifically resolving my question. Links you gave me is just information to just how to filter conditions which I already have in my example but not how to not filter or accept these certain domains.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

The documentation was offered to help point you in the right direction, as we don't offer support for custom Exim filter rules. That said, you may find the following option under the "Access Lists" tab in "WHM >> Exim Configuration Manager" helpful:

Only-verify-recipient

Per it's description:

Hosts or IP addresses that should be exempt from all spam checks at SMTP time, except recipient verification. Hosts or IP addresses you enter here are stored in /etc/trustedmailhosts.

Would that option help?

Thank you.
 

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
Thank you. Do I have to add smtp ip address of gmail? because it still didn't bypass cpanel exim filter even I entered gmail.com and google.com as a host to etc/trustedmailhosts since they have many smtp. I can't know what smtp ip address they use not only gmail . for instance ebay too.

{EDIT}
I also confirm that even smtp ip address I entered in etc/trustedmailhosts didn't successfully bypass filter. I did use one of my other servers smtp and send a mail from that server to exim, filter remain active no matter what I do.

condition = ${if match_ip{$sender_host_address}{iplsearch;/etc/trustedmailhosts}{1}{0}}
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

Can you provide more details about the specific filter rule you are attempting to exclude a specific domain name from? If it's for an actual filter rule in the system filter, then you are going to need to edit the Exim system filter file as per the instructions at:

How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation

This document shows how to create a custom system filter file, but it won't tell you the specific rule to use. We are unable to assist you with developing a custom filter rule, so you may need to seek out the help of a qualified system administrator if that's what you are looking for:

System Administration Services | cPanel Forums

Thank you.
 

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
Hello,
I have already implemented custom filter and custom filter file successfully imported into /etc/cpanel_exim_system_filter as below. What I expected was whatever host or smtp IP in /etc/trustedmailhosts should bypass my custom file however it is not. I am not looking for specific rule to be bypass but all spam rules I added in the list for certain domains. The spam rule list is long I've just added some of them as below.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# BEGIN - Included from /usr/local/cpanel/etc/exim/sysfilter/options/customtechfilter
# (Use the Basic Editor in the Exim Configuration Manager in WHM to change)
# or manually edit /etc/exim.conf.localopts and run /scripts/buildeximconf
# SPAM FILTER START
if
# Header Spam
$header_subject: contains "Pharmaceutical"
or $header_subject: contains "Viagra"
or $header_subject: contains "seo"
or $header_subject: contains "Cialis"
or $header_subject: contains "pills"
or $header_subject: contains "bitcoin"

# From spam
or $header_from: contains "pharmacy"
or $header_from: contains "diet"
or $header_from: contains "weight loss"

# Body Spam
or $message_body: contains "Pharmaceutical"
or $message_body: contains "search traffic"
or $message_body: contains "search marketing company"
or $message_body: contains "website audit"
or $message_body: contains "Pay-On-Results"
or $message_body: contains "% off storewide"
or $message_body: contains "Pay-On-Results"
or $message_body: contains "bitcoin"

then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered."
seen finish
endif
# SPAM FILTER FINISHED
# END - Included from /usr/local/cpanel/etc/exim/sysfilter/options/customtechfilter
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463

danone

Member
Feb 26, 2014
8
0
1
cPanel Access Level
Root Administrator
yes that's what I did in my second example above

if
$header_from: does not contain "gmail.com" and
$header_subject: contains "seo"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered."
seen finish
endif
# SPAM FILTER FINISHED

and it is not working. still freeze the mail and waiting for me to push to deliver, only different is sender doesn't receive "you have been block by spammer mail" back. Is there any Exim forum specifically I get support from because this is very urgent and I need to fix as soon as possible. Thanks.
 
Last edited: