How can I do this with Sieve? I have a script like this: if header :value "ge" :comparator "i;ascii-numeric" ["X-Spam-Score"] ["25"] { discard; stop; } elsif header :value "ge" :comparator "i;ascii-numeric" ["X-Spam-Score"] ["5"] { fileinto "Junk"; stop; } else { redirect "user at test.com"; redirect "user at example.com"; keep; } Only the first redirect seems to be honored, the 2nd is not. The only other alternative I see is that I have to create an alias that contains those two addresses, and then I redirect to that alias -- but I would prefer if I can do this through sieve itself. Thanks very much, sorry this is not Dovecot question... but this is on a Dovecot mail server. :)
Timo Sirainen
2008-Aug-30 09:07 UTC
[Dovecot] sieve forward/redirect to multiple addresses
On Fri, 2008-08-29 at 07:11 -0700, Anil wrote:> redirect "user at test.com"; > redirect "user at example.com";..> Only the first redirect seems to be honored, the 2nd is not.Could be a bug in cmusieve implementation or it could be designed that way. In either case I'd rather not do anything about it. Dovecot will soon have a new Sieve implementation which allows multiple redirects: http://hg.rename-it.nl/dovecot-libsieve/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080830/8e125166/attachment-0002.bin>
Stephan Bosch
2008-Aug-30 14:28 UTC
[Dovecot] sieve forward/redirect to multiple addresses
Timo Sirainen wrote:> On Fri, 2008-08-29 at 07:11 -0700, Anil wrote: >> Only the first redirect seems to be honored, the 2nd is not. >> > Could be a bug in cmusieve implementation or it could be designed that > way. In either case I'd rather not do anything about it.Out of curiosity I took a look at the cmusieve sources and I could not spot the problem. I tested this at my end and I could not reproduce this, meaning that both of my redirects (in addition to the keep action) were delivered properly. So, it is definitely not designed that way and therefore this may be a bug or (less likely) a misconfiguration. I am using the latest 1.1 mercurial versions of dovecot and the dovecot cmusieve plugin. The logs should provide more information. After executing your script with alternate addresses, my logs look as follows (with mail_debug=yes): Aug 30 16:07:21 host deliver(stephan): cmusieve: Using sieve path: /home/stephan/dovecot.sieve Aug 30 16:07:21 host deliver(stephan): cmusieve: Executing script /home/stephan/dovecot.sievec Aug 30 16:07:21 host deliver(stephan): Sending a forward to <stephan at rename-it.nl> with return path <<stephan at host.rename-it.nl>> Aug 30 16:07:22 host deliver(stephan): msgid=<48B95410.3050402 at host.rename-it.nl>: forwarded to <stephan at rename-it.nl> Aug 30 16:07:22 host deliver(stephan): Sending a forward to <s.bosch at student.utwente.nl> with return path <<stephan at host.rename-it.nl>> Aug 30 16:07:23 host deliver(stephan): msgid=<48B95410.3050402 at host.rename-it.nl>: forwarded to <s.bosch at student.utwente.nl> Aug 30 16:07:24 host deliver(stephan): msgid=<48B95410.3050402 at host.rename-it.nl>: saved mail to INBOX> Dovecot will > soon have a new Sieve implementation which allows multiple redirects: > http://hg.rename-it.nl/dovecot-libsieve/ >That is correct. However, to prevent abuse, the RFC requires Sieve implementors to impose a limit on the maximum number of redirects executed. The new Dovecot Sieve is configured for a maximum of 4 redirects by default, which will be configurable. Regards, Stephan.