From: Timo Sirainen Date: Wed, 18 Mar 2009 18:40:58 +0000 (-0400) Subject: imap-parser: Added IMAP_PARSE_FLAG_MULTILINE_STR flag. X-Git-Tag: 1.2.beta3~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2afd36af4a12549a0c89ba1bdf9ef424dc6f31d;p=thirdparty%2Fdovecot%2Fcore.git imap-parser: Added IMAP_PARSE_FLAG_MULTILINE_STR flag. --HG-- branch : HEAD --- diff --git a/src/lib-imap/imap-parser.c b/src/lib-imap/imap-parser.c index a05897ad8c..2d6bb85d1b 100644 --- a/src/lib-imap/imap-parser.c +++ b/src/lib-imap/imap-parser.c @@ -304,7 +304,8 @@ static int imap_parser_read_string(struct imap_parser *parser, /* 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; } diff --git a/src/lib-imap/imap-parser.h b/src/lib-imap/imap-parser.h index 517aba5ac1..5194f2fcb2 100644 --- a/src/lib-imap/imap-parser.h +++ b/src/lib-imap/imap-parser.h @@ -28,7 +28,9 @@ enum imap_parser_flags { /* 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 {