+1 vote

How ccan I know if an email is signed without loading the message?

If I use a loop to read the emails in the folder:

IMail email = new MailBuilder().CreateFromEml(
    imap.GetMessageByUID(uids[i]));

I can find with the property "isSigned" on IMail interface.

but in my case if I do not want to load all attachments and want a fast loop using the class MessageInfo:

List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);

I can not know if the mail is signed.

by

1 Answer

0 votes

Unfortunately it is not possible using MessageInfo class.

Although MessageInfo.BodyStructure contains information about entire email structure in some cases it is impossible to distinguish between signed only and encrypted email without access to the email content or at lest S/MIME part headers.

This is why those properties (IsSigned, IsEncrypted) are not present on BodyStructure class - they wouldn't be 100% reliable.

by (297k points)
...