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
{{ message }}
Repository navigation
Ignore malformed recipient addresses and continue parsing email data #321
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)
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.
changed the title [-]ArrayIndexOutOfBoundsException in org.simplejavamail.internal.util.MiscUtil.interpretRecipient[/-][+]Ignore malformed recipient addresses and continue parsing email data[/+]on Jun 12, 2021
Activity
GnTeezer commentedon Jun 11, 2021
I'm using version 6.6.0
bbottema commentedon Jun 12, 2021
That's not a valid recipient address and the email is malformed. Why do you want to process that email?
GnTeezer commentedon Jun 12, 2021
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.interpretRecipientI could see that it was handling theAddressExceptionby falling back to a default behaviour so that aRecipientwas returned - I thought that might have been the intention for any address that it couldn't parse not just when anAddressExceptionwas thrown.[-]ArrayIndexOutOfBoundsException in org.simplejavamail.internal.util.MiscUtil.interpretRecipient[/-][+]Ignore malformed recipient addresses and continue parsing email data[/+]#321: ignore malformed recipient addresses and continue parsing email…
bbottema commentedon Jun 12, 2021
Fixed in 6.6.1