[Dovecot] Problem with sieve. dovecot 2.0.17

Dennis Guhl
Tue, 23 Oct 2012 16:21:27 -0000

On Tue, Oct 23, 2012 at 05:19:04PM +0200, Eliezer Croitoru wrote:

[..]

> the script is:
> require ["fileinto", "envelope"];
> if envelope :is "from" "eliezer at test.dom" {
>   fileinto "old";

    stop; # seems to be needed with explicit keep

> } else {
>   # The rest goes into INBOX
>   # default is "implicit keep", we do it explicitly here
>   keep;
> }

Comparing various sieve scripts I concluded (but I didn't actually
test it) that you need a stop; in your if or elsif clauses in case you
have an else clause with an explicit keep; -- IMHO a behaviour
violating RFC 5228.

	RFC 5228, Section 3.1

	...

	If the test of the "if" is false, it evaluates the test of the
	first "elsif" (if any).  If the test of "elsif" is true, it
	runs the elsif's block.  An elsif may be followed by an elsif,
	in which case, the interpreter repeats this process until it
	runs out of elsifs.

	When the interpreter runs out of elsifs, there may be an
	"else" case. If there is, and none of the if or elsif tests
	were true, the interpreter runs the else's block.

	...

Stefan, can you enlighten us?

Dennis

[..]