maildrop should move spam in spambox

Discussion in 'Installation/Configuration' started by admins, Feb 17, 2010.

  1. admins

    admins Member

    Hi all

    Amavis tags spam with ***SPAM*** in my rule.
    So I want, that maildrop checks if it haves a folder "spam" in the mailbox if no, he create a folder, if yes he puts the spam in this box.

    Has someone an idea how I could make this globally?

    thanks
    admins
     
  2. BorderAmigos

    BorderAmigos New Member

  3. admins

    admins Member

    For all

    /var/vmail/.mailfilter

    put following into:

    Code:
    #####  Spamrule
    
    `test -e "$DEFAULT/.Spam" && exit 1 || exit 0`
    if ( $RETURNCODE != 1 )
    {
            `maildirmake -f "Spam" $DEFAULT`
            `chmod -R 0700 "$DEFAULT/.Spam"`
            `echo "INBOX.Spam" >> $DEFAULT/courierimapsubscribed`
    }
    if (/^Subject: \*\*\*SPAM/:h)
    {
    exception {
    ID2EndFolder = "$DEFAULT/.Spam/"
    to $ID2EndFolder
    }
    }
    *** RULE End
    
    Greets
    admins
     

Share This Page