Uploaded image for project: 'James Mailbox'
  1. James Mailbox
  2. MAILBOX-284

Error handling for Attachment parser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • master
    • master
    • store
    • None

    Description

      ```
      java.lang.IllegalStateException: 'cid' is mandatory for inline attachments
      at org.apache.james.mailbox.model.MessageAttachment$Builder.build(MessageAttachment.java:79)
      at org.apache.james.mailbox.store.mail.model.impl.MessageParser.retrieveAttachment(MessageParser.java:106)
      at org.apache.james.mailbox.store.mail.model.impl.MessageParser.listAttachments(MessageParser.java:84)
      at org.apache.james.mailbox.store.mail.model.impl.MessageParser.retrieveAttachments(MessageParser.java:67)
      at org.apache.james.mailbox.store.StoreMessageManager.extractAttachments(StoreMessageManager.java:438)
      at org.apache.james.mailbox.store.StoreMessageManager.appendMessage(StoreMessageManager.java:394)
      ```

      And exception is caught here :

      ```
      try

      { return messageParser.retrieveAttachments(contentIn); }

      catch (Exception e)

      { LOG.warn("Error while parsing mail's attachments: " + e.getMessage(), e); return ImmutableList.of(); }

      ```

      Extreme error handling : No attachment will be created for JMAP if one attachement is not well formatted

      If an attachment is failing (IE inline without CID), and the message have an other valid attachment, then the MessageAttachmentParser should have one attachment.

      Write JMAP integration test for this too

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              btellier Benoit Tellier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: