Skip to content
Snippets Groups Projects
Commit 81e52c9c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Work around exception on spammy mail...

Don't include the obsolete unstructured regex in abs.unstrctured,
and use the abnf.unstructured for parsing headers.

This fixes an issue seen running the IMAP server on gratuitously
spammy messages.
parent 295ae393
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -354,7 +354,8 @@ abnf.obs_phrase="(?:"+abnf.word+"(?:"+abnf.word+"|\\.|"+abnf.CFWS+")*)";
abnf.phrase=abnf.obs_phrase;
// 3.2.5 Miscellaneous Tokens
abnf.unstructured=abnf.obs_unstruct;
//abnf.unstructured=abnf.obs_unstruct;
abnf.unstructured="(?:(?:"+abnf.FWS+"?"+abnf.VCHAR+")*"+abnf.WSP+"*)";
// 3.3 Date and Time Specification
abnf.day_name="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)";
......@@ -603,7 +604,7 @@ function parse_header(str)
var m;
var re;
re=new RegExp("^("+abnf.field_name+")"+abnf.WSP+"*:"+rfc5322abnf.unstructured+""+abnf.CRLF,"i");
re=new RegExp("^("+abnf.field_name+")"+abnf.WSP+"*:"+abnf.unstructured+""+abnf.CRLF,"i");
m=re.exec(str);
if(m==null)
return(undefined);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment