0

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.

MetroidFan2002
  • 29,217
  • 16
  • 62
  • 80
  • Does http://stackoverflow.com/questions/19104680/adding-a-default-signature-to-outlook-email-vba help? Just to clarify, are you referring to an HTML signature snippet, or a digital signature for secure e-mail? (As described here: http://office.microsoft.com/en-us/outlook-help/secure-messages-with-a-digital-signature-HP001230539.aspx) – AdamsTips Nov 13 '14 at 19:43
  • 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 Nov 13 '14 at 22:01
  • Gotcha. You might check out http://stackoverflow.com/questions/3299120/outlook-vba-messageclass-save-digital-signature – AdamsTips Nov 13 '14 at 22:07

1 Answers1

0

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.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78