Sieve fileinto copies messages instead of moving them

Dauser Martin Johannes mdauser at cs.sbg.ac.at
Thu Mar 7 15:16:35 EET 2019


Micheal, just for your information: "stop;" stops the whole script at
this very line, which means no other rule will be applied on this
message anymore. Most of the time this is desired. Otherwise "elsif"
(and "else" as a catch-all) is your friend.  

require ["fileinto"];

# rule:[check if either SPAM or SPAMSPAM]
if header :contains "subject" "SPAMSPAM"
{
    fileinto "SPAM";
}
elsif header :contains "subject" "SPAM"
{
    fileinto "MaybeSPAM";
}

# rule:[something else needs to be done with message]
if blah
{
    action;
} 


On Thu, 2019-03-07 at 02:57 -0500, Helmut K. C. Tessarek via dovecot
wrote:
> You are missing a stop after the fileinto. Otherwise it will not stop, but
> rather processing the next rule as well.
> 
> Change it to:
> 
> require ["fileinto"];
> # rule:[SPAM]
> if header :contains "subject" "SPAMSPAM"
> {
>     fileinto "SPAM";
>     stop;
> }
> # rule:[SPAMSPAM]
> if header :contains "subject" "SPAM"
> {
>     fileinto "MaybeSPAM";
>     stop;
> }
> 
> Cheers,
>   K. C.
> 


More information about the dovecot mailing list