Exchange Sink - discard recipients in email
From: Razzie (razzie_at_quicknet.nl)
Date: 09/15/04
- Next message: Shane: "Memory leak when using MAPI to extract messages from Exchange Serv"
- Previous message: Michael Sven: "Re: EVENT SINK FIRES INTERMITENTLY"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Sep 2004 22:58:40 +0200
Hey all,
I sincerely hope someone can help me with this problem.
I wrote an Event Sink, using ISmtpInCommandSink. I use the following method
(C#):
void ISmtpInCommandSink.OnSmtpInCommand(object pServer, object pSession,
MailMsg pMessage, ISmtpInCommandContext pContext)
I listen for the RCPT command, and I can read the recipient from the command
in the method, so that works ok. Now I want a recipient to not recieve the
email, in other words, simply discard the RCPT. But whatever I try, the
recipient will always get it. I tried many things:
- Setting the CommandStatus, for example: Context.CommandStatus = (uint)
ProtocolEventConstants.EXPE_COMPLETE_FAILURE; or EXPE_S_CONSUMED, but it
won't ignore the command
- Throw COMException, but that always (?) terminates the session, I don't
want that something that drastic.
- Try to read the MailMsg reference passed through the method, but pMessage
never seems to contain data. For example, the Rfc822FromAddress property is
always null, while I already used the MAIL command. So I can't seem to read
the Recipients from the email and delete the last one.
Does anyone know how I can accomplish this? Help would really be
appreciated, I've come so far after lots of research, and I got stuck at
this last thing.
Thanks in advance,
Razzie
- Next message: Shane: "Memory leak when using MAPI to extract messages from Exchange Serv"
- Previous message: Michael Sven: "Re: EVENT SINK FIRES INTERMITENTLY"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|