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!

Use antivirus.exim to delete SPAM emails

Discussion in 'E-mail Discussion' started by asmithjr, Sep 27, 2018.

  1. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    510
    Likes Received:
    5
    Trophy Points:
    168
    I'm trying to filter emails and send them to /dev/null when they are marked SPAM. below is a sample from the /etc/antivirus.exim file.
    Code:
    logfile /var/log/filter.log
    if
     $header_subject: contains "SPAM"
    then
     logwrite "$tod_log $h_from $h_to $header_subject (the subject contains SPAM)"
     save /dev/null
     finish
    endif
    
    I'm watching and see these messages get logged to /var/log/filter.log yet the messages end up in queue showing the From and To then eventually show up with bounce as the from.
    I would like to just have the filter remove these messages all together as my queue will eventually fill up with these messages. Anyone have a solution to this. I've been on the forums for days trying to get this to work properly. I've even put the save /dev/null before the logwrite.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,707
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @asmithjr

    When I create this filter through the UI I get the following

    Code:
    if
     $header_subject: contains "SPAM"
    then
     save "/dev/null" 660
     finish
    endif
    Now I just used the Global Filters UI to create this but it can be copied to the exim filter as well. It is normal for these messages to be logged to the exim log as they are processed then discarded. If you paste the syntax in regard to sending the message to /dev/null do you continue to see bounces?

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice