Re: sieve "vacation" and duplicated emails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-07-22 at 12:49 -0700, Andrew Morgan wrote:
> On Wed, 22 Jul 2009, Bernd Petrovitsch wrote:
[....]
> > If I add a "vacation" statement (with a known working local email
> > address) as in
> > ----  snip  ----
> > require [ "fileinto", "vacation" ];
> > vacation :days 7 :addresses [ "user@xxxxxxxxxxx" ] "Bin im Urlaub ...";
> > if header :contains [ "X-Spam-Flag" ] [ "YES" ] {
> > fileinto "INBOX/Spam";
> > } else {
> > keep;
> > }
> > ----  snip  ----
> > each (non-spam-)mail, which triggers a vacation response, is stored 2
> > times in the INBOX (and not just once - from the "keep").
> 
> This does sound a bit like a bug, but I think your sieve rules are 
> somewhat out-of-order as well.  Here is how I would write it:
> 
> require [ "fileinto", "vacation" ];
> if header :contains "X-Spam-Flag" "YES" {
>  	fileinto "INBOX/Spam";
>  	stop;
> }
> vacation :days 7 :addresses [ "user@xxxxxxxxxxx" ] "Bin im Urlaub ...";

> "stop" tells sieve to stop processing the message.  With "stop" in place, 
> you don't need a clunky "else { keep; }" clause.  There is an implicit 
> "keep" action if a message is not fileinto'd a different mailbox.
The above is the reduced version for exactly on "if" - my
personal .sieve script sorts mailing-lists in different folders and it's
far smaller with the one clunky "else" after an if-cascade than having a
"stop" after each "if".
Other than that: It's probably more a matter of style and/or taste than
anything else IMHO.

> Also, you want the vacation responder to avoid processing spam emails.
ACK, sending `vacation` for detected Spams is probably not a very good
idea.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux