bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)

Home Page:http://www.simplejavamail.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: Support Exchange proprietary addresses (X.500 DAP)

dwlabcube opened this issue · comments

When the recipient is a "strange" address in a .msg file the MiscUtil will throw.
java.lang.IllegalArgumentException: emailAddressList is required
at org.simplejavamail.internal.util.Preconditions.verifyNonnullOrEmpty(Preconditions.java:49) ~[core-module-8.3.1.jar:na]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Please see the attachment in order to get an idea of how that address looks like.
Unfortunately i can not share the email with you since it holds sensitive data and I do not know how to reproduce it easily.

emailListTo

It seems to have it's root in handleNameAddressProperty in OutlookRecipient class
AddressParser

Suggestion:
erase the null check in MiscUtil and just log a warning instead of throwing an exception.
Or add a check in handleNameAddressProperty that does not check only on @ but also has an OR with startsWith("/o")

I created a Pull request in the outlookmessageparser repo:
dwlabcube:patch-X500-Outlook-Recipient

Is that even a value Outlook/Exchange can resolve? I don't think I've ever seen an address value like this, but perhaps it's valid Exchange-speak.

Yes outlook was able to resolve it properly. It seems to be something with caching and resolving X500 Address or something like that. I have no clue about all that, but it seems to be valid stuff though.

if you google for "/o=exchangelabs/ou=exchange administrative group" you'll find some information. but honestly i didn't get it what exactly is going on.

if you don't mind just accepting empty email-address in the miscutil i am very fine with it as well.
maybe there is even a cleaner solution?

8.3.3 was released with improved X500 support when parsing Outlook messages!