]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Understand utf8 in content-disposition parser
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Sep 2020 13:58:35 +0000 (14:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Sep 2020 13:58:35 +0000 (14:58 +0100)
src/ragel/content_disposition.rl
src/ragel/smtp_base.rl

index abcd7796f2a79332fca794eefd53a3828c044538..ff00dce949762ba1bec9d46e1df1c97b7dba3aca 100644 (file)
@@ -7,7 +7,7 @@
   balanced_ccontent := ccontent* ')' @{ fret; };
   comment        =   "(" (FWS? ccontent)* FWS? ")";
   CFWS           =   ((FWS? comment)+ FWS?) | FWS;
-  qcontent = qtextSMTP | quoted_pairSMTP;
+  qcontent = qtextSMTP | quoted_pairSMTP | textUTF8;
   quoted_string = CFWS?
                   (DQUOTE
                     (((FWS? qcontent)* FWS?) >Quoted_Str_Start %Quoted_Str_End)
index c9cc910610d961ca67998513a3314b4a0f0e9d4c..cb4f066bc395da70bb4964b6dd82186c9fedd5c4 100644 (file)
 
   quoted_pairSMTP  = "\\" 32..126;
   qtextSMTP      = 32..33 | 35..91 | 93..126;
+  utf8_cont = 0x80..0xbf;
+  utf8_2c   = 0xc0..0xdf utf8_cont;
+  utf8_3c   = 0xe0..0xef utf8_cont utf8_cont;
+  utf8_4c   = 0xf0..0xf7 utf8_cont utf8_cont utf8_cont;
+  textUTF8  = qtextSMTP | utf8_2c | utf8_3c | utf8_4c;
   Atom           = atext+;
   Dot_string     = Atom ("."  Atom)*;
   dot_atom_text  = atext+ ("." atext+)*;