Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-282

DefaultMessageWriter.writeMessage doesn't produces the same original eml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.8.1
    • None
    • dom
    • None

    Description

      I'm using mime4j to parse messages starting from a javax.mail.Message.
      Then, my application needs to store in a String the original message too, that is the "eml", I did it in this way:

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
       MessageWriter writer = new DefaultMessageWriter();
       writer.writeMessage(message, baos);
       this.originalMessage = baos.toString();

      Unfortunately I've seen that above code, does QP encoding so the final output is different from the original message.

      But in this way, the final eml results in a different eml from the original one, so for example the digital signature is not more valid.
      For example if you open the generated eml with a client like Outlook, it warns user that the digital signature is not valid.

      Now, I would like to know if exists a way to, starting from an eml generated with the above code, generate the correct version, so without QP encoding.

      Attached to this issue, I put an original eml and that one generated with above code, thanks

      Maybe this issue is related or caused to this other #MIME4J-186 ?

      Attachments

        1. mirmps_1_mime4j.eml
          421 kB
          Raffaele Gambelli
        2. mirmps_1.eml
          421 kB
          Raffaele Gambelli

        Activity

          People

            Unassigned Unassigned
            Gamby1980 Raffaele Gambelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: