Please, fix indentation (use spaces).
To exclude PGP messages this check need to be a little bit more specific. See https://github.com/roundcube/roundcubemail/blob/master/plugins/enigma/lib/enigma_engine.php#L499
I just found out that the test for smime-signatures does not work as expected: $struct is always null and so a signed only mail is not recognized.
For me there a two possibilities to fix this:
- Change test so it loops over all attachments and parts and checks if at least one has a mimetype of 'application/pkcs7-signature' then use the 'IPM.Note.SMIME.MultipartSigned' messageClass
- Implement a new method has_smime_sig in rcube_message class analogue to has_html_part() and check the result in the test.
Solution one looks like a good thing because it is completely "local" change but also may cause the check for smime signatures to be implemented multiple times if anybody else needs it. Solution feels more like the "right" way because ultimately the message (represented by the rcube_message class) should "know" it's features. Also the rcube_message class would be the central point to implement this only once for everyone to consume.
Please advise how to proceed and which solution you would prefer.