Sieve fileinto copies messages instead of moving them

Helmut K. C. Tessarek tessarek at evermeet.cx
Thu Mar 7 09:57:38 EET 2019


On 2019-03-07 02:52, Michael Goth via dovecot wrote:
> require ["fileinto"];
> # rule:[SPAM]
> if header :contains "subject" "SPAMSPAM"
> {
>     fileinto "SPAM";
> }
> # rule:[SPAMSPAM]
> if header :contains "subject" "SPAM"
> {
>     fileinto "MaybeSPAM";
> }
> 
> 
> But when I receive a message with subject "SPAMSPAM", the message turns up in
> "SPAM" and "MaybeSPAM". Is this expected behaviour?

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.

-- 
regards Helmut K. C. Tessarek              KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://dovecot.org/pipermail/dovecot/attachments/20190307/64bee442/attachment.sig>


More information about the dovecot mailing list