From: Martin Mares Date: Sun, 9 Feb 2014 23:51:10 +0000 (+0100) Subject: Relaxed parsing of encoded MIME headers X-Git-Tag: v1.6~1 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0b0b4009e2fdcf023e54b65949e58e178195cacc;p=checkmail.git Relaxed parsing of encoded MIME headers --- diff --git a/charset.c b/charset.c index 0f76670..c80ce9e 100644 --- a/charset.c +++ b/charset.c @@ -232,7 +232,8 @@ static const char *find_encoded_word (const char *s, const char **x) ; if (q[0] != '?' || !strchr ("BbQq", q[1]) || q[2] != '?') continue; - for (q = q + 3; 0x20 < *q && *q < 0x7f && *q != '?'; q++) + /* non-strict check since many MUAs will not encode spaces and question marks */ + for (q = q + 3; 0x20 <= *q && *q < 0x7f && (*q != '?' || q[1] != '='); q++) ; if (q[0] != '?' || q[1] != '=') {