Enabled IMAP and SMTP debug (see attachments) and tested against a DBMail internal mail server and an external one (GMail to simplify test repeatability).

Attached files are related to the GMail session.

As you can see, IMAP response differs on main mime part headers structure, so i think that's the reason for sign verification failure.

Any idea on how to fix this?

Thanks!

Stefano

 

SMTP log

....... cut .......

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)

--=_12a667e67cfa1dc2752a3a26a0315da3
Content-Type: multipart/mixed;
 boundary="=_6252574eb3ef7a89798cdb7924177af2"

....... cut .......

 

IMAP log (response)

....... cut .......

[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] C: A0008 UID FETCH 9460 (BODY.PEEK[1.MIME])
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] S: * 31 FETCH (UID 9460 BODY[1.MIME] {80}
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] S: Content-Type: multipart/mixed; boundary="=_6252574eb3ef7a89798cdb7924177af2"
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] S:
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] S: )
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] S: A0008 OK Success
[28-Jul-2016 10:23:17 +0200]: <ml905lhg> [17EE] C: A0009 UID FETCH 9460 (BODY.PEEK[1])

....... cut .......

 

Parsed IMAP response

....... cut .......

Content-Type: multipart/mixed; boundary="=_6252574eb3ef7a89798cdb7924177af2"

....... cut .......

 

 

 

Il 2016-07-28 08:34 A.L.E.C ha scritto:

On 07/27/2016 04:11 PM, sgironella@schema31.it wrote:
I've noticed that the signed message has an extra newline between main
headers and body (take a look at the highlited rows) so I thing that's
why sign verification fails (content doesn't match with original message).

Works for me, but I have an idea that it could be some IMAP response
parsing issue or IMAP server issue. Could you provide imap_debug log for
the moment when you open the message?

And this is the relevant part of the code, in case you'd like to work on
this by yourself.

https://github.com/roundcube/roundcubemail/blob/release-1.2/plugins/enigma/lib/enigma_engine.php#L1185-L1187