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 Configuration Manager > Custom Filter. Not Working

Discussion in 'E-mail Discussions' started by DigitalComunic, Apr 23, 2016.

  1. DigitalComunic

    Joined:
    Jan 17, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi all.

    I have an issue with the custom filter functionality.

    I need to configure some custom filters and I need that these filters not be excluded in futures cpanel updates, then I followed the instrucitions to create custom filter rules here:
    How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation

    I created a file called spamsubject at "/usr/local/cpanel/etc/exim/sysfilter/options/"
    Then, in the "WHM > Exim Configuration Manager > Basic Editor > Filters tab" I see at the bottom the "Custom Filter: subjectspam [?] ON (default)".

    This little code bellow is working well when I insert directly at "/etc/antivirus.exim", I tested and the filter works fine, but when I put in the "/usr/local/cpanel/etc/exim/sysfilter/options/subjectspam", the filter don't works. I already restart exim all the times.

    What could be the problem?

    The server is WHM 54.0 (build 21), is this version working well with exim custom filters?

    Code:
    # test
    
    if
    $header_subject: contains "viagra"
    
    then
    fail text "Rejected by spam words at subject"
    
    seen finish
    endif
    Thanks in advance by any help.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you post the output from /var/log/exim_mainlog for the test message you sent after enabling this system filter rule? EX:

    Code:
    exigrep user@test /var/log/exim_mainlog
    Was this test email sent from a remote mail server?

    Thank you.
     
  3. DigitalComunic

    Joined:
    Jan 17, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hello, cPanelMichael :)
    Sure, let's go.

    Yes, I did the tests from a @gmail.com to local

    This is the log when the filter is in /usr/local/cpanel/etc/exim/sysfilter/options/subjectspam
    Filter didn't worked. Message arrives in local mail.
    Code:
    2016-04-25 20:39:52 1auq6Z-003Lh9-Cd H=mail-ob0-f173.google.com [209.85.214.173]:36659 I=[98.142.98.102]:25 Warning: "SpamAssassin as digitalc detected message as NOT spam (-100.0)"
    
    2016-04-25 20:39:52 1auq6Z-003Lh9-Cd <= celsopecuraro@gmail.com H=mail-ob0-f173.google.com [209.85.214.173]:36659 I=[98.142.98.102]:25 P=esmtps X=TLSv1.2:RC4-SHA:128 CV=no S=4932 id=CAE-F3gTU7tv_T3ew6FKhe8-t8sGHN80bzBWnK6oJs4MPf-sWkQ@mail.gmail.com T="compre viagra" from <celsopecuraro@gmail.com> for celso@digitalcomunic.com.br
    2016-04-25 20:39:52 1auq6Z-003Lh9-Cd => celso <celso@digitalcomunic.com.br> F=<celsopecuraro@gmail.com> R=virtual_user T=virtual_userdelivery S=5058
    2016-04-25 20:39:52 1auq6Z-003Lh9-Cd Completed

    And this is the filter in antivirus.exim
    Filter worked, same message subject, and the email returned to @gmail with the message error.
    Code:
    2016-04-25 20:45:26 1auqBw-003M5h-QN H=mail-oi0-f50.google.com [209.85.218.50]:35704 I=[98.142.98.102]:25 Warning: "SpamAssassin as digitalc detected message as NOT spam (-100.0)"
    2016-04-25 20:45:26 1auqBw-003M5h-QN <= celsopecuraro@gmail.com H=mail-oi0-f50.google.com [209.85.218.50]:35704 I=[98.142.98.102]:25 P=esmtps X=TLSv1.2:RC4-SHA:128 CV=no S=4927 id=CAE-F3gSn5VArgqh0rjoM8Vyfqe3uEKoqBa64=U9u9K-rORyodQ@mail.gmail.com T="compre viagra" from <celsopecuraro@gmail.com> for celso@digitalcomunic.com.br
    2016-04-25 20:45:26 1auqBw-003M5h-QN cancelled by system filter: Rejected by spam words at subject
    2016-04-25 20:45:26 1auqBw-003M5h-QN Completed

    Seems the files in /usr/local/cpanel/etc/exim/sysfilter/options/ are not working even the Exim Configuration Manager > Custom Filter are activated.

    regards.

     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    I believe the issue is with your filter syntax, as I was unable to reproduce the issue on a test system. Please try updating your custom filter rule to an entry such as this:

    Code:
    # test
    
    if $header_subject: contains "viagra"
    then fail text "Rejected by spam words at subject" endif
    Thank you.
     
Loading...

Share This Page