sign outgoing messages on ItemSend

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.
 
D

Dmitry Streblechenko

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
 
D

Dmitry Streblechenko

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?
 
M

mad

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?
 
D

Dmitry Streblechenko

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?
 
M

mad

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.
 
D

Dmitry Streblechenko

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.
 
M

mad

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
 
D

Dmitry Streblechenko

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
 

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