You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing msgs, sometimes there is an empty header at the beginning. parseHeader then crashes, because of the empty name.
I cannot provide the email, since it's from production. Here is a screenshot of the first few headers:
As you can see, the name and value is blank.
As a fix, I would suggest to ignore headers with blank name+value.
Stacktrace when calling org.simplejavamail.converter.EmailConverter.outlookMsgToEmail:
Suppressed: java.lang.IllegalArgumentException: name is required
at org.simplejavamail.internal.util.Preconditions.verifyNonnullOrEmpty(Preconditions.java:49)
at org.simplejavamail.internal.util.Preconditions.checkNonEmptyArgument(Preconditions.java:30)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.withHeader(EmailPopulatingBuilderImpl.java:1705)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.withHeader(EmailPopulatingBuilderImpl.java:1697)
at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.parseHeader(OutlookEmailConverter.java:156)
at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.lambda$null$0(OutlookEmailConverter.java:104)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.lambda$buildEmailFromOutlookMessage$1(OutlookEmailConverter.java:104)
at java.base/java.util.HashMap.forEach(HashMap.java:1421)
at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.buildEmailFromOutlookMessage(OutlookEmailConverter.java:104)
at org.simplejavamail.internal.outlooksupport.converter.OutlookEmailConverter.outlookMsgToEmailBuilder(OutlookEmailConverter.java:89)
at org.simplejavamail.converter.EmailConverter.outlookMsgToEmailBuilder(EmailConverter.java:245)
at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:227)
at org.simplejavamail.converter.EmailConverter.outlookMsgToEmail(EmailConverter.java:219)
The text was updated successfully, but these errors were encountered:
bbottema
changed the title
[bugfix] crash on parsing empty header name and value
Bug: IllegalArgumentException on parsing empty header name and value (when parsing Outlook message)
Mar 8, 2023
When parsing msgs, sometimes there is an empty header at the beginning.
parseHeader
then crashes, because of the empty name.I cannot provide the email, since it's from production. Here is a screenshot of the first few headers:
As you can see, the name and value is blank.
As a fix, I would suggest to ignore headers with blank name+value.
What do you think?
Relevant code.
Stacktrace when calling
org.simplejavamail.converter.EmailConverter.outlookMsgToEmail
:The text was updated successfully, but these errors were encountered: