I've started using the cpanel_exim_system_filter_custom to filter emails for the server. I've noticed since doing so the queue seems to always have delivery emails hung for a while. Before implementing the use of the file I rarely would see this.
Here is what I have
Notice I've also now tried to use "ends" instead of "contains" because I want to remove emails that end with something. It seems even though the contains is ".ru" for example it seems to remove emails with ru in them.
I really need to use the cpanel_exim_system_filter_custom since there are several domains that would benefit from this rather than a separate filter for each domain.
What am I doing wrong or is there a better way?
Here is what I have
Code:
if (
("$h_to:, $h_cc:" ends ".date")
or ("$h_from:" ends ".date")
or ("$h_to:, $h_cc:" ends ".men")
or ("$h_from:" ends ".men")
or ("$h_to:, $h_cc:" ends ".us")
or ("$h_from:" ends ".us")
)
then
logwrite "$tod_log $h_from $h_to (Ends date men)"
seen finish
endif
#For blocking all incoming and outgoing RUSSIAN emails
if (
("$h_to:, $h_cc:" contains ".date")
or ("$h_from:" contains ".date")
or ("$h_to:, $h_cc:" contains ".men")
or ("$h_from:" contains ".men")
or ("$h_to:, $h_cc:" contains ".life")
or ("$h_from:" contains ".life")
or ("$h_to:, $h_cc:" contains ".ru")
or ("$h_from:" contains ".ru")
or ("$h_to:, $h_cc:" contains ".stream")
or ("$h_from:" contains ".stream")
or ("$h_to:, $h_cc:" contains "qq.com")
or ("$h_from:" contains "qq.com")
or ("$h_to:, $h_cc:" ends ".us")
or ("$h_from:" ends ".us")
)
then
logwrite "$tod_log $h_from $h_to (contains ru qq.com strean date)"
seen finish
endif
# send everything with SPAM in subject to null
if
$header_subject: contains "SPAM"
then
logwrite "$tod_log $h_from $h_to $header_subject (subject contains SPAM)"
save "/dev/null" 660
seen finish
endif
I really need to use the cpanel_exim_system_filter_custom since there are several domains that would benefit from this rather than a separate filter for each domain.
What am I doing wrong or is there a better way?