[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
On Mon, 2007-09-03 at 05:53 +0400, Gregory Mokhin wrote:
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
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;"?
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:
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: ..
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
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).
On Sun, 2007-09-09 at 17:56 +0400, Gregory Mokhin wrote:
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
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?
deliver is taking the wrong value for the mailbox. The recipient address was mok+test@k.. in this case. ("test" being the part of the address, not the name of a mailbox).
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).
dovecot messages were logged into a separate file and there were no other errors.
Regards, Gregory
On Sat, 2007-09-22 at 18:49 +0400, Gregory Mokhin wrote:
On Sun, 2007-09-09 at 17:56 +0400, Gregory Mokhin wrote:
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
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?
deliver is taking the wrong value for the mailbox. The recipient address was mok+test@k.. in this case. ("test" being the part of the address, not the name of a mailbox).
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?
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