-
Notifications
You must be signed in to change notification settings - Fork 937
Failing test for ContentDispositionParser #850
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
base: master
Are you sure you want to change the base?
Failing test for ContentDispositionParser #850
Conversation
Hi, I looked into lib/mail/parsers/ragel/common.rl and I think you should work on the section where it says:
and implement the missing grammar right from rfc2183. Anyway, If you look closely at rfc2183 (https://tools.ietf.org/html/rfc2183) section 2.4:
Being still a 'proposed standard' I wouldn't be surprised if you found it unquoted, though.. |
b4b84f4
to
38c85b1
Compare
Yes, I am definitely receiving emails without these values quoted. Is it better to implement this according to the proposed spec, or according to what emails are actually out in the wild? |
Robustness principle applies here: be liberal in what we accept, but be conservative in what we send. We should make a good effort to parse what's in the wild. |
I've dug around the ragel stuff in the code base now a few times, and I can't quite rap my head around it. Any tips on how to modify the ragel parser to handle this new case? |
The Content-Disposition parser (
Where
So
A parameter is optional folding whitespace containing comments followed by an ASCII name, "=", and an attribute value that's either a quoted string or one or more valid See Section 2.5.4 Strong Difference in the Ragel Guide for more on operators like To support unquoted parameter values, we'd need to update this grammar to allow spaces, commas, and colons in parameter values. This would likely break other legit headers, though. Maybe there's another route, like using a special-case fallback parser that scans for |
I looked into the parsers/ragel folder and I have no idea what I'm looking at there. Can you give me some hints as to what I should be changing to make this work?