-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Error on missing mimetype for attachments when parsing Outlook messages where mimeTag was not included #163
Comments
i looked a bit into it, the exception comes after the EmailPopulatingBuilder parses attachments, and a valid attachment has the mimTag=null Line 318 of the EmailConverter builder.withAttachment |
I'm unsure what to do since you closed the issue. Was it a user problem or a problem with the library? |
Oops, I mixed up the issue with one of my own projects, sorry!! I think the problem is with the library. When I parse an msg file without any attachments the converting itself throws no exception. Convertable msg files still show some issues, for example not parsing the sender correctly (field is null, although there is a sender). |
Hi @deeev, could you please try to reproduce this problem with https://github.com/bbottema/outlook-message-parser 1.1.17? That's the library being used under water (nearly the same API). If you can provide a sample .msg and the code you use to convert it, I'll dive into the problem and get it sorted out. Thanks so much! |
Sure, I'll dive right into it later today! |
Hi @deeev, had any luck with this yet? An example with Simple Java Mail would also be fine as long as I can reproduce it! |
Hi @bbottema I was able to reproduce the issue from @deeev, with outlook-message-parser and with simplejavamail, only throws in simplejavamail due to precondition for mime type. Sample code below, msg as attachment (sample-email.zip) The msg was created in Outlook by creating a new email with subject, recipient, body and a .txt file as attachment, then saving it as msg.
Kind regards and thanks |
That was very helpful, @stephan-merkli! So what you have is an Outlook email with an attachment that is missing a mimetype. I don't think that is technically valid! Can you try with your version of Outlook if this happens for files other than text files as well? If an image or zip for example are stored correctly with mimetype, try the following: take an image or a zip or something, and give it the extension .txt. Is it stored with or without mimetype? I'm not sure how to deal with this; I suppose when opening the email, Outlook tries to guess the mimetype by the file's extension? /edit: seems like it: https://stackoverflow.com/a/44907420/441662 |
Some methods to determine mimetype based on filetype using the JDK: |
Implemented enhancement in bbottema/outlook-message-parser#6 release 1.1.18. Updated Simple Java Mail accordingly in 5.1.4. @deeev, @stephan-merkli, can you please verify the issue is solved? |
Tested with outlook-message-parser 1.1.18, Output is Filename: ipsum.txt; Mime tag: text/plain. |
Hi guys,
I'm getting a "org.simplejavamail.converter.internal.msgparser.OutlookMessageException: Unable to parse Outlook message" exception when parsing a file, which is a msg file I save from outlook, using EmailConverter().outlookMsgToMimeMessage().
With another filepath (which seems wrong) I get a mimetype is required exception.
Could anyone help me troubleshooting?
Best regards
Deeev
The text was updated successfully, but these errors were encountered: