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.

Deliver Spam to Spam folder, globally

Discussion in 'E-mail Discussions' started by intelihost, Jan 20, 2017.

Tags:
  1. intelihost

    intelihost Registered

    Joined:
    Jan 20, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hi guys.
    I had this Exim Filter set up globally, so all Spam was delivered right to a Spam Folder.
    Then I set up a new server running CentOS 7 and decided to set the rule up again, using the /usr/local/cpanel/etc/exim/sysfilter/options directory, so it would be listed as a separate filter in Mail Settings.

    However, nothing happens. Can you guys help me out?

    Code is:
    Code:
    # Exim filter
    
    if not first_delivery and error_message then finish endif
    
    #Spam
    if ($h_X-Spam-Status: contains "Yes") then
      if "${if exists {$home/mail/$domain/$local_part/.Spam}{yes}{no}}" contains "yes"
       then
        save "$home/mail/$domain/$local_part/.Spam/" 660
        finish
       endif
    endif
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The filter rule would not work in cases where the .Spam folder is not yet created.

    An alternative method is to simply create the /home/$username/.spamassassinboxenable file under all accounts, which will enable the Spam Box option. There are some user-submitted commands discussed on the following thread:

    Apache SpamAssassin global enable anyone?

    Thank you.
     
Loading...

Share This Page