[Dovecot] recipient delimiter results in sieve errors
Hello,
I'm using dovecot 1.0.3 and Dovecot Sieve plugin 1.0.2. Sieve script works fine with normal addresses, like user@domain.., and messages marked with "X-Spam-Flag: YES" are delivered directly to INBOX.Spam.
To make deliver understand recipient_delimiter I tried two methods, the first one as per wiki (tweaking postfix master.cf), and the second one by tweaking dovecot-sql.conf (the main idea is to use concat(substring_index('%n',"+',1),'@','%d') for the username). Both methods work good.
However when deliver processes sieve script for the addresses with a delimiter, user+ext@domain.tld, there is an error:
deliver(test@k..): Info: cmusieve: Using sieve path: /home/vmail/.dovecot.sieve deliver(test@k..): Info: cmusieve: Executing script /home/vmail/.dovecot.sievec deliver(test@k..): Info: sieve runtime error: Keep: Generic Error deliver(test@k..): Error: sieve_execute_bytecode(/home/vmail/.dovecot.sievec) failed deliver(test@k..): Info: msgid=<..@mail...>: saved mail to INBOX
In that case message is delivered to INBOX, not to INBOX.Spam
Regards, Gregory
I guess it depends on what your Sieve code looks like? Or does it give the same error even if your script is only "keep;"?
It doesn't depend on the script. Even the simplest script "stop;" gives this error. I added two debug strings to cmusieve_deliver_mail in cmusieve-plugin.c:
if (getenv("DEBUG") != NULL) { i_info("cmusieve: Using mailbox: %s", mailbox); i_info("cmusieve: Using username: %s", username); i_info("cmusieve: Using sieve path: %s", script_path); }
and here are some more details:
deliver(mok@k...): Info: cmusieve: Using mailbox: test deliver(mok@k...): Info: cmusieve: Using username: mok@k.. deliver(mok@k..): Info: cmusieve: Using sieve path: /home/vmail/.dovecot.sieve deliver(mok@k..): Info: cmusieve: Executing script /home/vmail/.dovecot.sievec deliver(mok@k..): Info: sieve runtime error: Keep: Generic Error
That is, if I send a message to mok+test@k.., in cmusieve_deliver_mail() the name of the mailbox is test. For normal address mok@k.. it is INBOX:
deliver(mok@k..): Info: cmusieve: Using mailbox: INBOX deliver(mok@k..): Info: cmusieve: Using username: mok@k..
Tested with dovecot 1.0.3 and dovecot-sieve 1.0.2.
Regards, Gregory
On Sun, 2007-09-09 at 17:56 +0400, Gregory Mokhin wrote:
So Sieve works normally but just not with "-m test" parameter? Or try running deliver from command line with different parameters, when does it fail and when does is succeed?
Although "Keep: Generic Error" sounds like Dovecot would have logged an error message. Are you sure there were no errors? They might have been written to different log file (http://wiki.dovecot.org/Logging).
Well, I'm confused. Did you want mok+test@ to deliver to "mok" user and "test" mailbox? If not, what did you want the "+" delimiter to do then?
I wanted to use amavis feature to auto-add +spam, +badh etc. to the addresses, including those relayed to non-local recipients. The message to mok+test is to be delivered to "mok" user. These extensions can be used, for example, for client filtering.
My Sieve script filters spam based on the presence of X-Spam-Flag header:
if header :matches ["X-Spam-Flag"] [ "YES" ] { fileinto "INBOX.Spam"; }
It fails with the presence of +test, +spam or any other extension with that generic error.
Regards, Gregory
participants (2)
-
Gregory Mokhin
-
Timo Sirainen