Exim custom filter not working

bubaweb

Member
Nov 4, 2014
7
0
1
cPanel Access Level
Root Administrator
I'm reciving too much spam on server, so I dont want make cpanel filter for each customer but I want to use whm exim filter.

I setup and activate a new Custom Filter in exim filter setup.
I just want to test a sample filter, but I really had too much trouble.
No way to see it working
Can some1 help me ?

##### rule 1 update 10-10-2017 #####
###########################
#
logfile /var/log/filter.log 0644
if
$header_subject: contains "viagra" or
$header_subject: contains "Viagra" or
$header_subject: contains "reddito ogni giorno"
then
save "/dev/null" 660
logwrite "$header_subject with $message_body"
seen finish
endif
########### end rule 1###############

It dosnt work. My vps main admin use a custom System Filter File. Could it be the trouble or I'm making errors or mistake in my onw filter ?
Thx
 

bubaweb

Member
Nov 4, 2014
7
0
1
cPanel Access Level
Root Administrator
I'm reciving too much spam on server, so I dont want make cpanel filter for each customer but I want to use whm exim filter.

I setup and activate a new Custom Filter in exim filter setup.
I just want to test a sample filter, but I really had too much trouble.
No way to see it working
Can some1 help me ?

##### rule 1 update 10-10-2017 #####
###########################
#
logfile /var/log/filter.log 0644
if
$header_subject: contains "viagra" or
$header_subject: contains "Viagra" or
$header_subject: contains "reddito ogni giorno"
then
save "/dev/null" 660
logwrite "$header_subject with $message_body"
seen finish
endif
########### end rule 1###############


It dosnt work. My vps main admin use a custom System Filter File. Could it be the trouble or I'm making errors or mistake in my onw filter ?
Thx
details ->
exigrep [email protected] /var/log/exim_mainlog
2017-10-10 23:38:41 1e22EL-0006cB-NX => me <[email protected]> F=<[email protected]> R=virtual_user T=dovecot_virtual_delivery S=3121 C="250 2.0.0 <[email protected]> OH+IFeE93VltYQAAlXullg Saved"
2017-10-10 23:38:41 1e22EL-0006cB-NX Completed
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello,

Could you let us know the full steps you took to add and enable the filter?

Thank you.
 

bubaweb

Member
Nov 4, 2014
7
0
1
cPanel Access Level
Root Administrator
just go to whm ->
  • Home »
  • Service Configuration »
  • Exim Configuration Manager
then basic editor -> filter, I enable filter after creating it in /usr/local/cpanel/etc/exim/sysfilter/options/name_filter

My isp add a custom filter to allow eml attach. Could be this the problem ?
see image for details ?
 

Attachments

Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello,

Could you open a support ticket using the link in my signature so we can take a closer look?

Thank you.
 

did-vmonroig

Active Member
Feb 6, 2012
40
0
56
cPanel Access Level
Root Administrator
Hello.

I think we've exactly same problem. Filter works if tested with:
Code:
sendmail -bF senders_blacklisted </tmp/test-mdrctr.eml
but it is ignored in normal operation.

May I know what was the problem or should I open a new thread or ticket?
 

cPWilliamL

cP Technical Analyst II
Staff member
May 15, 2017
258
30
103
America
cPanel Access Level
Root Administrator
Hi @did-vmonroig,

It looks like the underlying issue here was that the user was using both methods to set a custom exim filter, the first method done by his host, and the second method done by himself.

First, the default system filter is `/etc/cpanel_exim_system_filter'. This file is dynamically generated against filters in the `/usr/local/cpanel/etc/exim/sysfilter/options/' directory; it does not use includes. In this case, the host setup the server with a custom 'system_filter' in place of the usual `/etc/cpanel_exim_system_filter'. Then, the user added his custom filter file to `/usr/local/cpanel/etc/exim/sysfilter/options/'.

At this point, the host had already copied the generated `/etc/cpanel_exim_system_filter' to a custom file and added their changes. The custom 'system_filter' file was generated before the user added their latest filter rules to `/usr/local/cpanel/etc/exim/sysfilter/options/', hence it was not applied, albeit the UI seems to indicate it's active. It's active for the default system filter file, but default system filter file is not in use.

I've filed an internal case under 'CPANEL-16503' with our developers, for our UI allowing users to enable Custom Filter files when a Custom System Filter file is already set. Ideally, there should be some warning or the options greyed out entirely.

Thanks,
 
  • Like
Reactions: did-vmonroig