[Dovecot] How to do line breaks in sieve scripts?

Stephan Bosch stephan at rename-it.nl
Fri Aug 8 01:56:53 EEST 2008


CJ Keist wrote:
> In working with auto vacation replies I'd like to do a sieve script as
> follows:
> 
> require ["vacation"];
> vacation
> :days 30
> :addresses "cj.keist at colostate.edu"
> :subject "Out of Office"
> "***************** Out of Office ******************
> 
> I'm away -- send mail to foo in my absence
> 
> ***************************************************";
> 
> 
> But the libsieve-php.sourceforge.net check site doesn't like the line
> breaks.  Is there a way to do line breaks in sieve scripting?
> I've tried "\" at the end of the lines but that didn't work.
Actually, the libsieve-php is wrong.

 From RFC 5228 Section 8.1 (http://tools.ietf.org/html/rfc5228):

  quoted-safe        = CRLF / octet-not-qspecial
                           ; either a CRLF pair, OR a single octet other
                           ; than NUL, CR, LF, double-quote, or backslash
  quoted-text        = *(quoted-safe / quoted-special / quoted-other)
  quoted-string      = DQUOTE quoted-text DQUOTE

So, presuming that the lines end in CRLF and not just LF (on this part 
the RFC is too strict in my opinion), your script is valid (I verified). 
You can probably work around this bug using a literal string:

require ["vacation"];
vacation
:days 30
:addresses "cj.keist at colostate.edu"
:subject "Out of Office" text:
****************** Out of Office ******************

  I'm away -- send mail to foo in my absence

***************************************************
.
;

Or use the sievec binary to (test-) compile your sieve scripts.

Regards,

Stephan




More information about the dovecot mailing list