-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mailmime_parse() parses the mail unexpectly #431
Comments
The function mailimf_fws_parse() does not support obs-FWS, which is defined in RFC5322, section 3.2.2. For the example in #431, when [email protected] is parsed and mailimf_fws_parse() is called after that, it will set cur_token at the position of '\r' in the 5th line. This will cause problems in certain situations. The example in #431 triggers the problem because the message-id afterwards is invalid. Another examples which also trigger problems are that there is a "WSP CRLF" line in the To header field or there are more than three continuous "WSP CRLF" lines in the References header field (see below).
The bugfix here adds the support of obs-FWS and fixes all these problems. |
Support obs-FWS in the FWS parser (dinhvh#431)
The mailmime_parse() function in the master branch parses the following mail unexpectly:
Here is the code to parse the mail:
Compile and output:
libetpan marks the end of the 5th line as the end of the header.
libetpan will parse the header correctly with any of the changes below:
The 5th line contains only a TAB. It is an obsolete syntax in RFC 5322, section 4.2, but the section 4 of the same RFC also says that "they MUST be accepted and parsed by a conformant receiver", so it should be considered as a Bug of libetpan.
The text was updated successfully, but these errors were encountered: