Re: Sieve fileinto copies messages instead of moving them

2019-03-07 Thread Dauser Martin Johannes via dovecot
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.
> 


Re: Sieve fileinto copies messages instead of moving them

2019-03-06 Thread Helmut K. C. Tessarek via dovecot
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.
*/



signature.asc
Description: OpenPGP digital signature


Sieve fileinto copies messages instead of moving them

2019-03-06 Thread Michael Goth via dovecot

Hi,

we're running Doveocot 2.3.4.1 with Pigeonhole, from repo.webflow.org.

As far as I understand the RFC for 'fileinto', the following Sieve 
script should move a message either into the folder "SPAM" or "MaybeSPAM":



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?



Thanks!

  Michael



--
Michael Goth

.webflow GmbH

Geschäftsführer: Andreas Schrei
Wasserburger Straße 4
D - 83352 Altenmarkt a. d. Alz

Amtsgericht Traunstein HRB 18537

E-Mail:   m...@webflow.de
Tel:  +49 (0) 8621 - 99989 - 26
Fax:  +49 (0) 8621 - 99989 - 28
Web:  www.webflow.de