Archived Forum Post

Index of archived forum posts


Email SignaturesValid is false, how to find out what happened?

Aug 27 '13 at 08:44

We are using the CkMailMan/CkEmail classes for reading mails from a POP3 Server. For security reasons our software checks the validity of signatures of our received mails. Sometimes the get_SignaturesValid() Function returns “false” on signed mails.

My question:

Is there a way to find out what happened with these mails? I read the “lastErrorText()” output, but it contains only some information about the environment. I enabled verbose logging but this had no effect on the output as well.


The answer is that you need to capture the contents of the LastErrorText after the method call that is unwrapping the PCKS7 security layers of an S/MIME (signed and/or encrypted) email. This always happens at the time the signed/encrypted MIME is loaded into an email object. If, for example, a .eml file contains a signed/encrypted email, then calling CkEmail::LoadEml will cause the security layers to be unwrapped and the various email object properties relating to signed/encrypted to be set. Therefore, you would get CkEmail::lastErrorText() after calling CkEmail::LoadEml.

However, when downloading email from a POP3 server, the unwrapping happens at the point of downloading (assuming the method returns an email object). In this case, you would examine the CkMailMan::lastErrorText after the call that downloads the email. (Notice that it's the CkMailMan object, not the CkEmail object. You want the lastErrorText on the same object instance that made the call. Also note that the LastErrorText always contains information about what transpired. This way, if something was successful, but didnt' quite work as expected, then it's still possible to get information.)