if (ctx->data >= ctx->end)
return -1;
+ if (*ctx->data == '\r' || *ctx->data == '\n') {
+ /* quoted-pair doesn't allow CR/LF.
+ They are part of the obs-qp though, so don't
+ return them as error. */
+ ctx->data--;
+ break;
+ }
str_append_data(str, start, ctx->data - start - 1);
start = ctx->data;
break;
{ "\"\"\"", "", 1 },
{ "\"\\\"\"", "\"", 0 },
{ "\"\\\\\"", "\\", 0 },
- { "\"\\\\foo\\\\foo\\\\\"", "\\foo\\foo\\", 0 }
+ { "\"\\\\foo\\\\foo\\\\\"", "\\foo\\foo\\", 0 },
+ { "\"foo\n bar\"", "foo bar", 0 },
+ { "\"foo\n\t\t bar\"", "foo\t\t bar", 0 },
+ { "\"foo\\\n bar\"", "foo\\ bar", 0 },
+ { "\"foo\\\r\n bar\"", "foo\\ bar", 0 },
};
struct rfc822_parser_context parser;
string_t *str = t_str_new(64);