On 03/17/2017 12:07 AM, Doug Barton wrote:

Not precisely. You want to remove the 'else' in there, as the clause you have will do the opposite of what you intend. Also note that I removed your superfluous square brackets.

require "fileinto";
  if header :contains "X-Spam-Flag" "YES" {
    fileinto "Spam";
  }
  if header :contains "subject" "***SPAM***" {
    fileinto "Spam";
  }

This is a pretty good tutorial on the syntax and options for Sieve. Given your intended purpose you should pay special attention to the 'create' modifier for 'fileinto'. Also, I would accomplish both things in the same rule using 'anyof' which should be slightly more efficient (which could make a big difference to server load depending on how many users you are supporting).

https://support.tigertech.net/sieve

Reading this and 'man sievec'...

Here is how I have modified your script above:

require "fileinto";
if anyof
    (
        header :contains "X-Spam-Flag" "YES",
        header :contains "subject" "***SPAM***"
    )
{
    fileinto "Spam";
}

And for sievec, I still use:

sieve_before = /home/sieve/globalfilter.sieve

dovecot will find the /home/sieve/globalfilter.svbin and proceed with that. I don't have to specify the svbin in the sieve_before option.

thanks

Bob

Reply via email to