-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Quirky received
header breaks date parsing
#81
Comments
The date seems correct, it's the CRLF that is breaking the parser. Although the ABNF does not allow CRLFs within a date, any whitespace can be replaced with a CRLF in order to fold the lines. |
sbeckeriv
added a commit
to sbeckeriv/mail-parser
that referenced
this issue
Mar 1, 2025
Dearest Reviewer, I looked at issue stalwartlabs#81 and found that the CRLF was adding whitespace to the text during the integer parsing. I added a trim call to the error flow and try parsing again. I did this because it appears to be the exceptional case and normal flows will not take the cost of trim with every process. I can move the trim back out. I used the failing test that was provided. Thanks for your time Becker
sbeckeriv
added a commit
to sbeckeriv/mail-parser
that referenced
this issue
Mar 1, 2025
Dearest Reviewer, I looked at issue stalwartlabs#81 and found that the CRLF was adding whitespace to the text during the integer parsing. I added a trim call to the error flow and try parsing again. I did this because it appears to be the exceptional case and normal flows will not take the cost of trim with every process. I can move the trim back out. I used the failing test that was provided. Thanks for your time Becker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got sent a mail which makes the parser output
None
for thereceived
date. Here is a test case to reproduce the problem:The problem is the line break (
\r\n
) inside the date part.I am not an expert, but looking at RFC 5322, this case looks to me like the obsolete date and time syntax. Is this crate meant to support that? Or are we supposed to work around this? (E.g. by reading the
Date
header field in these cases.)By the way, thanks for your work on this. Really useful for my upcoming mail client :)
The text was updated successfully, but these errors were encountered: