sign outgoing messages on ItemSend

  • Thread starter Thread starter mad
  • Start date Start date
M

mad

Hello everybody!

I'm writing an add-on for Outlook 2007 in Delphi. The purpose of this
add-on is to add digital signature to the outgoing messages. I use
event OnItemSend.

At the moment i save IMessage to MIME by
IConverterSession.MAPIToMIMEStm. Next, That file signed by external
application and i try to load signed file to IMessage by
IConverterSession.MIMEToMAPI. But then Outlook sends loaded message,
and it become little modified.
For example:
Content-Type: text/plain;charset="us-ascii"
becomes:
Content-Type: text/plain;
charset="us-ascii"
Naturally, signature is no longer valid.

So, how can i add digital signature to outgoing messages? Should I add
a signature some other way or send signed MIME instead of the original
message?

Thank you.
 
Have you tried to simply set the appropriate value of PR_MESSAGE_CLASS to
let Outlook do the \rest?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Try "IPM.Note.SMIME.MultipartSigned"

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

The values of PR_MESSAGE_CLASS is "IPM.Note". What value instead of
this should i set?
 
And when shoud i set it to "IPM.Note.SMIME.MultipartSigned"? Before
export message to MIME? Before import signed MIME to message? Or after
import?
 
If I remember correctly, you don't have to do anything but set the message
class - Outlook will sign the message appropriately when its sees the right
message class for the message beign sent.

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

And when shoud i set it to "IPM.Note.SMIME.MultipartSigned"? Before
export message to MIME? Before import signed MIME to message? Or after
import?
 
But with which certificate Outlook will sign the message then? How to
set certificate to sign the message with?
At the moment, after
MailItem.MessageClass := 'IPM.Note.SMIME.Multipartsigned';
MailItem.Save;
Outlook crashes while sending message.
 
Can you send signed/encrypted messages through Outlook?

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

But with which certificate Outlook will sign the message then? How to
set certificate to sign the message with?
At the moment, after
MailItem.MessageClass := 'IPM.Note.SMIME.Multipartsigned';
MailItem.Save;
Outlook crashes while sending message.
 
Yes, i can. But i cant't install my certificate to clients machines.

Anyway... I need to generate some signature for outgoing message and
put it in X-header, for example. And when the message will be recieved
by outlook with my add-in installed, then the message can be verified
based on that signature.

Can i get the stream, that outlook send to smtp-server?

Because if i calculate signature for exported message (by MapiToMime)
and put it to X-header, then Outlook generate new message for smtp
while sending. And "------=_NextPart_000_0009..." becomes to "------
=_NextPart_000_000D...", so i can't verify my signature.

p.s. sorry for my english
 
No, I don't think you can access the MIME stream that OUtlook will create...

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

Yes, i can. But i cant't install my certificate to clients machines.

Anyway... I need to generate some signature for outgoing message and
put it in X-header, for example. And when the message will be recieved
by outlook with my add-in installed, then the message can be verified
based on that signature.

Can i get the stream, that outlook send to smtp-server?

Because if i calculate signature for exported message (by MapiToMime)
and put it to X-header, then Outlook generate new message for smtp
while sending. And "------=_NextPart_000_0009..." becomes to "------
=_NextPart_000_000D...", so i can't verify my signature.

p.s. sorry for my english
 
Back
Top