sieve "vacation" and duplicated emails

Andrew Morgan morgan at orst.edu
Wed Jul 22 15:49:00 EDT 2009


On Wed, 22 Jul 2009, Bernd Petrovitsch wrote:

> If I have the following sieve script, everything works fine and each
> (non-Spam-)mail appears once in the INBOX (since we have the "keep"
> there)
> ----  snip  ----
> require [ "fileinto", "vacation" ];
> if header :contains [ "X-Spam-Flag" ] [ "YES" ] {
> fileinto "INBOX/Spam";
> } else {
> keep;
> }
> ----  snip  ----
> If I add a "vacation" statement (with a known working local email
> address) as in
> ----  snip  ----
> require [ "fileinto", "vacation" ];
> vacation :days 7 :addresses [ "user at example.com" ] "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 at example.com" ] "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.

Also, you want the vacation responder to avoid processing spam emails.

 	Andy


More information about the Info-cyrus mailing list