@j_briere,
Actually, MailMessage does not support address in EX format and only supports SMTP. If you need to get original MSG properties, you need to use MapiMessage.fromFile without double conversion.
public void test() throws Exception
{
MapiMessage mapi = MapiMessage.fromFile("getSenderAddressType.msg");
printSenderAddress(mapi);
// !!! double conversion
MailMessage eml = MailMessage.load("getSenderAddressType.msg", new MsgLoadOptions());
MapiMessage mapiFromEml = MapiMessage.fromMailMessage(eml, new MapiConversionOptions());
printSenderAddress(mapiFromEml);
}
private void printSenderAddress(MapiMessage mapi) {
System.out.println("--------------------------------------");
System.out.println(mapi.getSenderAddressType());
System.out.println(mapi.getSenderEmailAddress());
System.out.println(mapi.getSenderSmtpAddress());
System.out.println(mapi.getSenderName());
}
Output:
EX /O=THE UNIVERSITY OF TEXAS-PAN AMERICAN/OU=BUSINESS AFFAIRS/CN=RECIPIENTS/CN=PAULA
null
Paula Berkley
SMTP
null
null
Paula Berkley