0
votes

Is there any way to

  1. Retrieve a digital signature attached to a MailItem using VBA?
  2. Verify its validity using VBA?

I'm pretty much limited to VBA in this regard. I've tried inspecting the Sender and MailItem objects but I can't see anything about a Signature object.

1
Does stackoverflow.com/questions/19104680/… help? Just to clarify, are you referring to an HTML signature snippet, or a digital signature for secure e-mail? (As described here: office.microsoft.com/en-us/outlook-help/…)AdamsTips
The latter - I'm not looking for some text at the bottom of the message, but a signature verifying that the email was truly sent from the sender.MetroidFan2002
Gotcha. You might check out stackoverflow.com/questions/3299120/…AdamsTips

1 Answers

0
votes

Outlook always represents signed/encrypted messages as regular "IPM.Note MailItem" objects. It goes as far as returning a fake IMessage MAPI interface from the MailItem.MAPIOBJECT property.

You can see this in OutlookSpy (I am its author) - select a signed message, click IMessage button on the OutlookSpy ribbon. PR_MESSAGE_CLASS will be IPM.Note. Select the PR_ENTRYID property, right click, select IMAPISession::OpenEntry. You will get back the real message with PR_MESSAGE_CLASS = IPM.Note.SMIME.MultipartSigned. You can see the attachment that contains the data.

You are pretty much limited to Extended MAPI (C++ or Delphi only) or Redemption (I am its author - any language - it wraps Extended MAPI) if you want to distinguish signed/encrypted message from the regular ones. Redemption exposes RDOEncryptedMessage object. You can retrieve it from RDOSession.GetMessageFromID using the entry id retrieved from MailItem.EntryID property in OOM.