[Dovecot] How to do line breaks in sieve scripts?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
In working with auto vacation replies I'd like to do a sieve script as follows:
require ["vacation"]; vacation :days 30 :addresses "cj.keist@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.
C. J. Keist Email: cj.keist@colostate.edu UNIX/Network Manager Phone: 970-491-0630 Engineering Network Services Fax: 970-491-5569 College of Engineering, CSU Ft. Collins, CO 80523-1301
All I want is a chance to prove 'Money can't buy happiness' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIm2UwA29OFr7C6jcRAn7mAKCokJxNCkTiwyXuSo1qDjZ+9xqVfgCdG3vC DC+/BIiQVqZN+U8CzwWdxgQ= =4+0r -----END PGP SIGNATURE-----
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@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@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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stephan, Thank you, didn't realize how buggy the libphp-sieve was. It does compile fine with sievec.
Stephan Bosch wrote:
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@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@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
C. J. Keist Email: cj.keist@colostate.edu UNIX/Network Manager Phone: 970-491-0630 Engineering Network Services Fax: 970-491-5569 College of Engineering, CSU Ft. Collins, CO 80523-1301
All I want is a chance to prove 'Money can't buy happiness' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFInFoXA29OFr7C6jcRAlZpAJ9fhgKiVyoAzC2jUo22k+ItoyFO5QCg2Lyx hifGvi1kwbZ6uFsfAd9WxVs= =6cnM -----END PGP SIGNATURE-----
CJ, Sephan,
On Friday 08 August 2008 16:37:11 CJ Keist wrote:
Thank you, didn't realize how buggy the libphp-sieve was. It does compile fine with sievec.
Fixed the issue last night. If you find other bugs, please let me know through the bug-tracker in the future. I rely on feedback to get the last ones out. So, if anyone is fancy to check your script and run into something, let me know.
Stephan Bosch wrote:
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).
The line breaks were not the problem. Instead I used the wrong pattern modifier so that multiline quoted strings never matched. Classic one-liner fix.
Regards Heiko
participants (3)
-
CJ Keist
-
Heiko Hund
-
Stephan Bosch