C++/VB - Secure Email using MAPI

Asked By gregg1ep00
22-Jan-10 11:19 AM
I need to encrypt/sign messages using MAPI.  I have used HrSetOneProp to set
the PR_SECURITY_FLAGS on my IMessage interface, but the mail is still sent
unencrypted/unsigned.  I used MFCMapi to look at the properties of the
message, and I see the tag 0x6E010003 listed with a value of 3.

After doing further research, I think this is only viable when using the
Outlook Object Model.  We have tested setting this property on an IMailItem
and Outlook does indeed sign/encrypt the message as expected.

The runtime environment has Outlook 2007 installed, and is running an
extremely locked-down version of Windows Vista (the FDCC build with Army Gold
Master).  The problem with using the OOM is that we have experienced a ton of
issues accessing Outlook programmatically because of other security measures
that are in place in their environment (lots of Outlook add-ins and Exchange
Client Extensions), thus the reason I'd like to avoid having to use Outlook.

Can somebody please help me understand the steps required to sign/encrypt a
MAPI message?  What properties must be set?  Do I have to do the
encrypting/signing myself, or does the MAPI subsystem take care of that?

Thanks in advance,
Greg
Windows Vista
(1)
Outlook 2007
(1)
Outlook
(1)
HrSetOneProp
(1)
MFCMapi
(1)
IMailItem
(1)
OutlookSpy
(1)
IMessage
(1)
  Dmitry Streblechenko replied to gregg1ep00
22-Jan-10 04:12 PM
I assume you have seen
http://blogs.msdn.com/dvespa/archive/2009/03/16/how-to-sign-or-encrypt-a-message-programmatically-from-oom.aspx
AFAIK the message indeed needs to be sent through Outlook.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
  gregg1ep00 replied to Dmitry Streblechenko
22-Jan-10 10:05 PM
Thank you so much for your response, Dmitry.  Yes, I have referenced that
article for our current implementation, which DOES use the OOM.  In most
installations it works fine.  But for whatever reason, in this particular
installation Outlook is giving us the infamous "extend.dat" error, and upon
Outlook.Application instantiation we receive an E_ABORT.  I have driven
myself absolutely crazy trying to troubleshoot this, and as far as I know
there is no other way to instantiate the Outlook.Application object in "safe
mode", or disabling all extensions/addins, etc.

It is for this reason that ideally, we would really like to get away from
relying on the OOM to send signed/encrypted mail.  It must be possible,
because Outlook itself is able to send these messages signed/encrypted via
MAPI, right?  I am sure it is not a trivial thing to accomplish, though.  :-)
  nick replied to gregg1ep00
03-Feb-10 12:26 AM
Hi

I believe that OOM IS the right direction.

Can you please give the detailed error code that you received from the
machine? What version of Outlook is installed? Can you share the code
snippet that gives the error?
Create New Account
help
Accessing Vista Windows Contacts with MAPI C++ / VB Is it still possible to access the new Vista Windows contacts using MAPI. I currently use MAPI to access the WAB and was hoping to continue to do so under Vista using Windows Contacts. Remove nospam for correct email address Win32 Messaging Discussions Vista (1) MAPI (1) Outlook (1) ExpandEnvironmentStrings (1) LoadLibrary (1) CLSCTX_INPROC_SERVER (1) PFactory (1) CLSID_Contact (1) A Windows Vista machine
opening *.dbx files in Vista (Windows Mail) C++ / VB Hello, I was an Outlook Express 6 (Windows 98) user and I have my e-mails saved in files such as "incoming.dbx", "best mails.dbx", . . .*.dbx. How can I open them in Windows Mail in Vista? VB Vista Compatibility Discussions Outlook (1) Vista (1) VB (1) ForVB (1) Windows (1) Dbx (1) Dbx (1) This is
Vista Windows Mail MAPIFindNext Problem C++ / VB I have a MAPI client program that worked just fine with Outlook Express on Windows 2000 and XP but returns an error with Windows Mail on Vista. I am querying the inbox for messages calling MAPIFindNext in a loop Windows Mail on Vista returns MAPI_E_FAILURE. This problem is documented at: http: / / support.microsoft.com / kb / 930279 Does anyone
Problems calling IMessage-> Send() on Windows Vista C++ / VB Send(), on, Windows, Vista" / > Hi, I am having a problem where I am getting the following the error: 0x80040201 Visual Studio 2008 that attempts to send 5 emails then exits. On an XP or Windows 2003 machine it works fine, but when it is run on a Windows Vista machine it sends the first email correctly, then crashes with the above exception when trying to send the second email. As Windows Vista doesn't ship with an SMTP Server I have tried: 1. Using a third
Windows Vista and NetSharingManager.EnumEveryConnection C++ / VB Hello, The following code snippet works on Windows XP SP2 (default user privilege), but not on Windows Vista (also only with default user privilege)! :-( Dim icsMgr As New NetSharingManager For Each icsConn As In icsMgr.EnumEveryConnection But, when I debug the code above as a local adminstrator on Windows Vista, then it works (no exceptions is thrown). What is the correct way to enumerate all network connections on Windows Vista, without local administrator privilege? Thanks and Regards, andersch Win32 Networks Discussions Support (1) Microsoft