[ 
https://issues.apache.org/jira/browse/MIME4J-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541279#comment-16541279
 ] 

Raffaele Gambelli commented on MIME4J-282:
------------------------------------------

For example, this is an extract from the original:

{quote}------=_Part_28457822_1533070911.1531324659015
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD><TITLE>Messaggio di posta certificata</TITLE></HEAD>
<BODY>
<H1>Messaggio di posta certificata</H1>
<P>Il giorno 11/07/2018 alle ore 17:57:39 (+0200) il messaggio<BR>
"Nota esplicativa modifiche statutarie" =E8 stato inviato da "palazzostrozz=
i...@boxpec.it"<BR>
indirizzato a:
<table border=3D0>
<tr><td>segr....@postacert.gruppo.mps.it</td></tr>
<tr><td>romina.ti...@banca.mps.it</td></tr>
</table>
Il messaggio originale =E8 incluso in allegato.</P>
<P>Identificativo messaggio: 6DFE68E1.00510A7F.8A0FF53B.17A50A12.posta-cert=
ific...@postacert.it.net</P>
</BODY></HTML>{quote}

and this is how it is generated with mime4j:

{quote}------=_Part_28457822_1533070911.1531324659015
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD><TITLE>Messaggio di posta certificata</TITLE></HEAD>
<BODY>
<H1>Messaggio di posta certificata</H1>
<P>Il giorno 11/07/2018 alle ore 17:57:39 (+0200) il messaggio<BR>
"Nota esplicativa modifiche statutarie" =E8 stato inviato da "palazzostroz=
zi@boxpec=2Eit"<BR>
indirizzato a:
<table border=3D0>
<tr><td>segr=2Egen@postacert=2Egruppo=2Emps=2Eit</td></tr>
<tr><td>romina=2Etilli@banca=2Emps=2Eit</td></tr>
</table>
Il messaggio originale =E8 incluso in allegato=2E</P>
<P>Identificativo messaggio: 6DFE68E1=2E00510A7F=2E8A0FF53B=2E17A50A12=2Ep=
osta-certificata@postacert=2Eit=2Enet</P>
</BODY></HTML>{quote}

You can see that is already QP encoded, but mime4j encoded also other 
characters, like all dots inside email addresses.

> DefaultMessageWriter.writeMessage doesn't produces the same original eml
> ------------------------------------------------------------------------
>
>                 Key: MIME4J-282
>                 URL: https://issues.apache.org/jira/browse/MIME4J-282
>             Project: James Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.8.1
>            Reporter: Raffaele Gambelli
>            Priority: Major
>         Attachments: mirmps_1.eml, mirmps_1_mime4j.eml
>
>
> 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:
> {code:java}
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
>  MessageWriter writer = new DefaultMessageWriter();
>  writer.writeMessage(message, baos);
>  this.originalMessage = baos.toString();{code}
> 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 ?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to