Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2054

Mail Component: Content-ID reference in multipart broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.1, 1.6.2, 2.0.0
    • 1.6.2, 2.1.0
    • camel-mail
    • None
    • Email clients like gmail, zimbra. Outlook 2003 works

    Description

      It looks like Camel Mail Component does not set Content-ID mime header correctly or probably assumption is that BodyPart will take care of it. As a result embedded images in html body do not work ( img src="cid:somename.img").

      Currently Content-ID is set as -

      //MailBinding.java
      // add a Content-ID header to the attachment
      messageBodyPart.addHeader("Content-ID", attachmentFilename.substring(4));

      But according to RFC standards http://www.ietf.org/rfc/rfc2392.txt, Content-ID value should be enclosed with in angle brackets, so it should be modified to -

      //MailBinding.java
      // add a Content-ID header to the attachment
      messageBodyPart.addHeader("Content-ID", "<" + attachmentFilename.substring(4) + ">");

      Also, below should be modified which incorrectly sets fileName inclusive of "cid:", but expectation would be strip off "cid" off it, similar to Content-ID

      // Set the filename
      messageBodyPart.setFileName(attachmentFilename);

      Should be -

      // Set the filename
      messageBodyPart.setFileName(attachmentFilename.substring(4));

      Also, RFC standard mentions that Content-ID should be globally unique but Camel Mail just sets it to filename instead. I understand this can be problematic as camel will have to replace references to each of such cid's in any of the mail parts.

      As I understand from RFC document, is that this is required in case you send emails itself attachments, and attachments can same name can trample each other(I may be wrong here). I guess we can live with this for a while

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            tide08 slad
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: