changeset 8837:c9d6ae6f10fe HEAD

imap-parser: Added IMAP_PARSE_FLAG_MULTILINE_STR flag.
author Timo Sirainen <tss@iki.fi>
date Wed, 18 Mar 2009 14:40:58 -0400
parents dc6880dcbbba
children 50815f24cc22
files src/lib-imap/imap-parser.c src/lib-imap/imap-parser.h
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap/imap-parser.c	Wed Mar 18 13:59:58 2009 -0400
+++ b/src/lib-imap/imap-parser.c	Wed Mar 18 14:40:58 2009 -0400
@@ -304,7 +304,8 @@
 		/* check linebreaks here, so escaping CR/LF isn't possible.
 		   string always ends with '"', so it's an error if we found
 		   a linebreak.. */
-		if (is_linebreak(data[i])) {
+		if (is_linebreak(data[i]) &&
+		    (parser->flags & IMAP_PARSE_FLAG_MULTILINE_STR) == 0) {
 			parser->error = "Missing '\"'";
 			return FALSE;
 		}
--- a/src/lib-imap/imap-parser.h	Wed Mar 18 13:59:58 2009 -0400
+++ b/src/lib-imap/imap-parser.h	Wed Mar 18 14:40:58 2009 -0400
@@ -28,7 +28,9 @@
 	/* Return literals as IMAP_ARG_LITERAL instead of IMAP_ARG_STRING */
 	IMAP_PARSE_FLAG_LITERAL_TYPE	= 0x04,
 	/* Don't check if atom contains invalid characters */
-	IMAP_PARSE_FLAG_ATOM_ALLCHARS	= 0x08
+	IMAP_PARSE_FLAG_ATOM_ALLCHARS	= 0x08,
+	/* Allow strings to contain CRLFs */
+	IMAP_PARSE_FLAG_MULTILINE_STR	= 0x10
 };
 
 enum imap_arg_type {