How to get the Form.OriginalAddressString utilizing the Java library

I have the same problem, but I’m unclear based on this answer how to get the Form.OriginalAddressString utilizing the Java library.

@tembenite

You can use MailAddress.OriginalAddressString to get the original e-mail address string. Hope this helps you.

If you still face problem, please share some more detail about your requirement along with input and expected output documents. We will then provide you more information on it.

Not sure how I missed your reply.

If I’m working with a PST, how do I get from a MapiMessage to a MailAddress to use this?

 IGenericEnumerator<MapiMessage> enumerable = inputRoot.enumerateMapiMessages().iterator();
        while (enumerable.hasNext()){
            MapiMessage message = enumerable.next();

@tembenite

We have logged your requirement in our issue tracking system as EMAILJAVA-35041. We will inform you via this forum thread once there is an update available on it.

We apologize for your inconvenience.

@tembenite

Please use the following code example to achieve your requirement. Hope this helps you.

IGenericEnumerator<MapiMessage> enumerable = inputRoot.enumerateMapiMessages().iterator();
while (enumerable.hasNext()) {
    MapiMessage message = enumerable.next();
    // print MSG FROM address
    System.out.println(message.getSenderEmailAddress());
    // OR convert to EML
    MailMessage eml = message.toMailMessage(new MailConversionOptions());
    // print EML FROM address
    System.out.println(eml.getFrom().getOriginalAddressString());
}