sieve filter move wrong email to Junk folder

Alex JOST jost+lists at dimejo.at
Fri Dec 15 15:36:42 EET 2017


Am 14.12.2017 um 18:47 schrieb Gao:
> I use a sieve filter to move spam email to user's Junk folder:
> # cat spam_to_junk.sieve
> require "fileinto";
>    if exists "X-Spam-Status" {
>            if header :contains "X-Spam-Status" "YES" {
>            fileinto "Junk";
>            stop;
>            } else {
>        }
>    }
>    if header :contains "subject" ["SPAM?"] {
>      fileinto "Junk";
>      stop;
>    }
> 
> Most time this filter works fine but occasionally it move non-spam in to 
> Junk folder. Here is an example, this email is from dovecot mailling 
> list and it end up in my Junk folder. Mailllog and header here. Would 
> someone help me to figure out what went wrong here?

> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
>   autolearn=ham version=3.3.2, No

AFAIK, header matching is case-insensitive. That's why 'YES' matches 
'BAYES' and triggers the action.
-- 
Alex JOST


More information about the dovecot mailing list