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
Unexpected newline in header key #2
Comments
Can you provide the email you are trying to parse? Feel free to remove any personal information, I just want to see the part upto the end of the headers. |
Closing for lack of information. |
Hi I think I have the same issue here with some mails (or most real world mails I tested). This is an example mail header part of a mail which has this issue (replaced personal mail address):
Please let me know if you need more information. |
What version of mailparse are you using to parse that mail? With the latest version it parses fine for me, I don't see the error message you refer to. |
I used 0.6.4 to parse it.
|
Are you sure there's no stray characters coming from msg.body()? One thing to try is to dump the msg.body().unwrap() result into a file and pass that file as an argument to my standalone test app at https://github.com/staktrace/mailparse-bin - if it fails with that then we can see what's different in what you pasted above vs in the file. |
It could well be that there are stray characters in that case. I tried a different approach now, which seems to work:
Using this, I can see the real content of the mails and don't see the 'Unexpected newline in header key' message anymore. I tested this with ~30 mails and all seems to work fine. Thank you very much for your help. |
Great, thanks for the update! |
Hi!
I've got "Unexpected newline in header key" on several emails from my mailbox.
I did a little research and have found "\r\nContent-Type..." input to parse_header func.
There's a really dirty workaround, but it works:
How to fix it correctly?
The text was updated successfully, but these errors were encountered: