Closed basinilya closed 3 years ago
It seems you have a better grasp of the internal Outlook model than I have. Would you be interested in providing pull requests? I would be happy to integrate any improvements you might have.
Give me some time. Meanwhile I figured out it's not easy to construct a test .msg file for reproduction. The bug is only visible when 7d HEADERS is the last property seen. However, poi traverses the properties binary tree in a way that does not maintain the index order. So in my test message 7d HEADERS is followed by 65 SENT REPRESENTING EMAIL ADDRESS
Attached the test file. (deleted property 65 with FlexHex, I hope it doesn't corrupt the message too much)
Test at sign in personal From header.msg.zip
getFromEmail()
is expected to return "bogus@domain.com"
, but it actually returns "\"bogus@acme.com\""
Fix released in 1.7.10. Thank you for your work!
Even though Sender Name and Email addresse are stored in the fields
0xc1f
and0x42
respectively, the parser extracts and overwrites this info from the transport headers0x7d
.If such a header contains quoted name with an @ at sign:
it wrongly calls
setFromEmail("\"bogus@domain.com\"", true)
When trying to use this e-mail with
javax.mail
it fails:Please consider reusing or copying
new javax.mail.internet.InternetHeaders(InputStream)
for splitting the headers andnew javax.mail.internet.InternetAddress(String)
for parsing the address string.