-
Notifications
You must be signed in to change notification settings - Fork 323
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
Not able to parse an email: no media type #24
Comments
Hey there! Unfortunately, this is an issue I'm working on. This is likely because you having a blank line at the beginning? If that's the case, try removing the blank line and giving it a shot again. I plan to strip that automatically soon.
|
Hey Jordan, I don't have a new line at the beginning, this seems to be from a different issue. I added a failure test in kalbasit/email@e614fb5 |
Thanks for that failure case! That helps quite a bit. I believe that there are two possible causes:
Let me look into this and I'll get back to you asap. |
perfect, thanks Jordan. |
Ok, I've found a few issues that need to get resolved. The root cause is that there is no Content-Type header. This should default to "text/plain; charset=us-ascii", but it looks like the logic to handle that is not in the stdlib (from what I can tell). So, when parsing the media type disposition, we get the error since there is no "Content-Type" in the map of headers. That's number one. The second issue is that my parsing logic currently assumes that the email will be a multipart email. So, even if you add the Content-Type, the body won't be parsed. I need to add the logic to handle non-multipart emails, so I'll probably make another issue for it. All in all, I'll probably setup two new issues for these, and keep this one open in the meantime until both are resolved. I'll knock this out as soon as I can, but it might be a week or so due to time constraints. |
That works for me, thanks Jordan. |
This is fixed, I have another issue though, so I'll open a separate issue for it |
Email content:
Getting the error
mime: no media type
when I try to parse the email above. Found that developing Gmuchemail_bug
branch.The text was updated successfully, but these errors were encountered: