Exhange 2016 IMAP at fetch BODYSTRUCURE splitted names/filenames with more than 60 chars only the first part is returned RRS feed

  • Question

  • This is an IMAP question coming from working with javamail towards an exchange server 2016

    Some mails have its attachment splitted like:
            name*0="1858289404-Direct Line-TK-150-EIC-XX 123-Sonstiges_185828940";
         Content-Transfer-Encoding: base64
            filename*0="1858289404-Direct Line-TK-150-EIC-XX 123-Sonstiges_185828940";

    If I get this mail-attachments with javamail via imap only "name" "1858289404-Direct Line-TK-150-EIC-XX 123-Sonstiges_185828940" is returned. So the 2nd part is lost: name*1="4_170627-1715_TB28.pdf"  
     - Javamail calls fetch 1 (BODYSTRUCTURE) in this step.
     - I can also replicate this by calling fetch 1 (BODYSTRUCTURE) via telnet in an imap-session.
     - There are no events in  the Exchange server at this issue and no errors in the Exchange-log at C:\inetpub\logs\LogFiles\W3SVCx.

    We have this problem with some mails. Some customers mail their attachments in this way: long attachement-names splitted in in several parts: Then the problem occurs with all size and type of attachments (from JPG to PDF – from small to large attachments) we receive – IF the filename-length of the attachment is > 60 and the filename is split into 2 or more lines:

    There are a some Stackoverflow-Posts, which discuss this issue(RFC 2231) - as this one:

    I paste here a testmail (test.eml), with which I can reproduce the problem: it returns only the first part (name*0 )– when I fetch the bodystructure with imap towards exchange 2016 (also if do this with javamail 1.5.2 or 1.5.4).
    Here is the link to test-Mail and also a sequence with imap-protocol:

    So is this a disabled property in exchange server 2016 or an error or do I still miss something?
    Best regards, Arno

    • Edited by A_C_20 Thursday, August 17, 2017 8:42 AM
    Monday, August 14, 2017 8:44 AM