bbottema/outlook-message-parser

NumberFormatException on parsing .msg files

Jonbeckas opened this issue · 4 comments

I have this problem with every email I parse with the normal simple java mail outlook module.
I just paste a few of the errors because otherwise this comment was way too long.


java.lang.NumberFormatException: For input string: "101f-00000004" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]


2020-10-27 15:19:41.362  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000006

java.lang.NumberFormatException: For input string: "101f-00000006" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]


2020-10-27 15:19:41.386  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000007

java.lang.NumberFormatException: For input string: "101f-00000007" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]


2020-10-27 15:19:41.399  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000005

java.lang.NumberFormatException: For input string: "101f-00000005" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]

2020-10-27 15:19:41.432  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000002

java.lang.NumberFormatException: For input string: "101f-00000002" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]


2020-10-27 15:19:41.446  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000003

java.lang.NumberFormatException: For input string: "101f-00000003" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]


2020-10-27 15:19:41.460  INFO 17236 --- [    Test worker] o.s.o.OutlookMessageParser               : Could not parse directory entry __substg1.0_8011101F-00000001

java.lang.NumberFormatException: For input string: "101f-00000001" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:658) ~[na:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.analyzeDocumentEntry(OutlookMessageParser.java:581) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.getMessagePropertyFromDocumentEntry(OutlookMessageParser.java:399) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryDocumentEntry(OutlookMessageParser.java:262) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.checkDirectoryEntry(OutlookMessageParser.java:208) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.outlookmessageparser.OutlookMessageParser.parseMsg(OutlookMessageParser.java:133) ~[outlook-message-parser-1.7.5.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseOutlookMsg(OutlookEmailConverter.java:119) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:62) ~[outlook-module-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:226) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:209) ~[simple-java-mail-6.4.4.jar:na]
	at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:201) ~[simple-java-mail-6.4.4.jar:na]

I attached an example email to the comment.

test.msg

Originally posted by @Jonbeckas in #28 (comment)

You have this with every mail you parse?? Is the source of the email consistently the same source? Are you able to parse the messages provided in the library test folder?

I reproduced the error with your test message, which was very helpful, thanks for that. Can I have your permission to include it in the test set?

I solved the issue (#28 duplicate), at least for this email. It seems to work well so I'll release a new version for you soon.

Fix released in 1.7.9. Hopefully your test sample was representative of the entire set!

Thanks! The new release fixed the problems in my test emails. Unfortunately i can't grant the permission to use the test message in ythe test files, because it contains data of the company I work for,