diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 15:15:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 15:15:52 +0100 |
commit | bf2e401ad6246569faff56ec69429451faf7bcbd (patch) | |
tree | 8b089c0562782fc34d07c62f8a435461b1338511 /src/ragel/rfc2047_parser.rl | |
parent | 0c1ce161f1ef22a32d4a545136c73f4f80ed40d6 (diff) | |
download | rspamd-bf2e401ad6246569faff56ec69429451faf7bcbd.tar.gz rspamd-bf2e401ad6246569faff56ec69429451faf7bcbd.zip |
[Feature] Work with broken rfc2047 tokens
Diffstat (limited to 'src/ragel/rfc2047_parser.rl')
-rw-r--r-- | src/ragel/rfc2047_parser.rl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ragel/rfc2047_parser.rl b/src/ragel/rfc2047_parser.rl index 05b08a6ae..26c016361 100644 --- a/src/ragel/rfc2047_parser.rl +++ b/src/ragel/rfc2047_parser.rl @@ -43,12 +43,12 @@ token = (graph - especials)+; charset = token; encoding = "Q" | "q" | "B" | "b"; - encoded_text = (print - ("?" | " "))+; + encoded_text = (print - ("?"))+; encoded_word = "=?" charset >Start_Charset %End_Charset ("*" language)? "?" encoding %End_Encoding "?" encoded_text >Start_Encoded %End_Encoded - "?="; + "?="?; main := encoded_word; }%% @@ -64,7 +64,8 @@ rspamd_rfc2047_parser (const gchar *in, gsize len, gint *pencoding, { const char *p = in, *pe = in + len, *encoded_start = NULL, *encoded_end = NULL, - *charset_start = NULL, *charset_end = NULL; + *charset_start = NULL, *charset_end = NULL, + *eof = in + len; gint encoding = RSPAMD_RFC2047_QP, cs = 0; %% write init; |