How to detect encrypted message?

  • Thread starter Igor Kolosovski
  • Start date
I

Igor Kolosovski

Hello.

I'm working on C++ ATL add-in for outlook 2007, which should detect if message is encrypted just before send. If no, then check its body using some mask and remind user to encrypt it if necessary. Even better to enable "Encrypt message..." property automatically.

It was not a problem to get _MailItem:

void __stdcall CAddin::OnSend(IDispatch *Obj,VARIANT_BOOL *CancelDefault)
{
CComQIPtr<Outlook::_MailItem> pMi(Obj);
//CComBSTR body;
//pMi->get_Body(&body);
....
}

, but I could not find how to check if message is encrypted. Is there some way?
Thanks in advance!


Submitted via EggHeadCafe - Software Developer Portal of Choice
ADO.NET Handling Concurrency Issues and Null Values in Updates
http://www.eggheadcafe.com/tutorial...62-61d636c0a04a/adonet-handling-concurre.aspx
 
I

Igor Kolosovski

Unfortunately MessageClass is always IPM.Note, when IPM.Note.SMIME is expected. Possible cause is that I perform check before send, but message is not encrypted yet and MessageClass is not set to necessary value.
Any ideas?
Thanks.



Ken Slovak - [MVP - Outlook] wrote:

Check the MessageClass of the item.--Ken Slovak[MVP - Outlook]http://www.
10-Dec-09

Check the MessageClass of the item

-
Ken Slova
[MVP - Outlook
http://www.slovaktech.co
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
File Management For No-Touch Deployments
http://www.eggheadcafe.com/tutorial...ef-ec39c7640d46/file-management-for-noto.aspx
 
K

Ken Slovak - [MVP - Outlook]

That's the only way I'm familiar with, but I don't deal with encrypted items
very often.

My only other suggestion is to grab items that are unencrypted and encrypted
and see what MAPI properties are different on them using a view such as
OutlookSpy or MFCMAPI.

You might also want to try that before and after saving the items.
 
D

Dmitry Streblechenko

Outlook always represents signed/encrypted messages as regular IPM.Note
messages. It goes sa far as furnishing a fake IMessage MAPI object returned
by the MailItem.MAPIOBJECT property.
You can reopen the message using MAPI/CDO 1.21/Redemption and then check the
Message class.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top