[Dovecot] sieve forward/redirect to multiple addresses
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@test.com"; redirect "user@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. :)
On Fri, 2008-08-29 at 07:11 -0700, Anil wrote:
redirect "user@test.com"; redirect "user@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/
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
Timo Sirainen wrote: 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@rename-it.nl with return path <stephan@host.rename-it.nl> Aug 30 16:07:22 host deliver(stephan): msgid=48B95410.3050402@host.rename-it.nl: forwarded to stephan@rename-it.nl Aug 30 16:07:22 host deliver(stephan): Sending a forward to s.bosch@student.utwente.nl with return path <stephan@host.rename-it.nl> Aug 30 16:07:23 host deliver(stephan): msgid=48B95410.3050402@host.rename-it.nl: forwarded to s.bosch@student.utwente.nl Aug 30 16:07:24 host deliver(stephan): msgid=48B95410.3050402@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.
participants (3)
-
Anil
-
Stephan Bosch
-
Timo Sirainen