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
I can't share the original email but the exception was caused because one of the addresses in the To field was this: (null)<>
Index 0 out of bounds for length 0: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at org.simplejavamail.internal.util.MiscUtil.interpretRecipient(MiscUtil.java:181)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.withRecipient(EmailPopulatingBuilderImpl.java:1501)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.withAddresses(EmailPopulatingBuilderImpl.java:1455)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.withAddressesWithDefaultName(EmailPopulatingBuilderImpl.java:1435)
at org.simplejavamail.email.internal.EmailPopulatingBuilderImpl.cc(EmailPopulatingBuilderImpl.java:1115)
at org.simplejavamail.converter.EmailConverter.buildEmailFromMimeMessage(EmailConverter.java:633)
at org.simplejavamail.converter.EmailConverter.mimeMessageToEmailBuilder(EmailConverter.java:120)
at org.simplejavamail.converter.EmailConverter.mimeMessageToEmail(EmailConverter.java:99)
at org.simplejavamail.converter.EmailConverter.mimeMessageToEmail(EmailConverter.java:91)
The text was updated successfully, but these errors were encountered:
I want to process it because I'm replacing a manual system with an automated one and these emails can be opened in any desktop/web client that I've tried so far (they just seem to ignore the malformed address).
I'm certainly no expert but most mail seems to be malformed at some level - we're already setting a lot of the mail.mime.* properties so we can process things that probably aren't technically valid.
I was only reporting this because when I looked at the code for MiscUtil.interpretRecipient I could see that it was handling the AddressException by falling back to a default behaviour so that a Recipient was returned - I thought that might have been the intention for any address that it couldn't parse not just when an AddressException was thrown.
bbottema
changed the title
ArrayIndexOutOfBoundsException in org.simplejavamail.internal.util.MiscUtil.interpretRecipient
Ignore malformed recipient addresses and continue parsing email data
Jun 12, 2021
I can't share the original email but the exception was caused because one of the addresses in the To field was this:
(null)<>
The text was updated successfully, but these errors were encountered: