# This is a patch against Cyrus 2.1.16 which ensures the the sieve parsing # engine (used by lmtpd) is reset correctly between runs. Otherwise syntax # errors in one sieve file can have knock on effects for other Sieve files. # From memory this patch came from someone else on the net. # --- cyrus-imapd-2.1.16/sieve/sieve.y 2002-12-03 18:45:19.000000000 +0000 +++ cyrus-imapd/sieve/sieve.y 2004-04-19 09:20:22.000000000 +0100 @@ -1,4 +1,5 @@ %{ +/* $Cambridge: hermes/src/cyrus-imapd/sieve/sieve.y,v 1.2 2003/06/17 15:39:25 dpc22 Exp $ */ /* sieve.y -- sieve parser * Larry Greenfield * $Id: sieve.y,v 1.21 2002/12/03 18:45:19 rjs3 Exp $ @@ -119,6 +120,7 @@ int yyerror(char *msg); extern int yylex(void); +extern void yyrestart(FILE *f); #define YYERROR_VERBOSE /* i want better error messages! */ %} @@ -520,10 +522,9 @@ commandlist_t *sieve_parse(sieve_script_t *script, FILE *f) { commandlist_t *t; - extern FILE *yyin; - yyin = f; parse_script = script; + yyrestart(f); if (yyparse()) { t = NULL; } else {