Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exim custom filter not working

Discussion in 'E-mail Discussions' started by bubaweb, Oct 10, 2017.

  1. bubaweb

    bubaweb Member

    Joined:
    Nov 4, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    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
     
  2. bubaweb

    bubaweb Member

    Joined:
    Nov 4, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    details ->
    exigrep user@test /var/log/exim_mainlog
    2017-10-10 23:38:41 1e22EL-0006cB-NX => me <mail@xxxxx> F=<user@test> R=virtual_user T=dovecot_virtual_delivery S=3121 C="250 2.0.0 <mail@xxxxxx> OH+IFeE93VltYQAAlXullg Saved"
    2017-10-10 23:38:41 1e22EL-0006cB-NX Completed
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
  4. bubaweb

    bubaweb Member

    Joined:
    Nov 4, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    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 ?
     

    Attached Files:

    #4 bubaweb, Oct 11, 2017
    Last edited by a moderator: Oct 11, 2017
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
  6. bubaweb

    bubaweb Member

    Joined:
    Nov 4, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Your Support Request ID is: 8940757
     
  7. did-vmonroig

    did-vmonroig Active Member

    Joined:
    Feb 6, 2012
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    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?
     
  8. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    115
    Likes Received:
    12
    Trophy Points:
    93
    Location:
    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,
     
    did-vmonroig likes this.
  9. did-vmonroig

    did-vmonroig Active Member

    Joined:
    Feb 6, 2012
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Root Administrator
    Thank you very much, cPWilliamL. I didn't realized there was a custom system filter file in use.

    Kind regards.
     
Loading...

Share This Page