Stack Overflow error when extracting msg-attachments from msg-file

Hi,

since version 23.5 I’m getting a stack-overflow error when trying to extract and process an embedded/forwarded e-mail. Basically this means that a msg-file contains another msg-file as an attachment and when I want to process this attached file my code gets stuck in an endless recursion.

Here is some sample code:

for (MapiAttachment attachment : mapiMessage.getAttachments()) {
    byte[] data = attachment.getBinaryData();
    
    try (var stream : new ByteArrayInputStream(data)) {
        var newMessage = MapiMessage.load(stream);

        ...

    } catch (Exception e) {
        ...
    }
}

As written above, the code works perfectly with version 23.4, but all versions above produce the same error.

Hello @s.glasenhardt,

Please share your sample message file with us for further investigation at our end.