Exchange Sink - discard recipients in email

From: Razzie (razzie_at_quicknet.nl)
Date: 09/15/04


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



Relevant Pages

  • Please help - Exchange Sink ignore command
    ... multiple newsgroups and forum but nobody seems to know? ... I changed the tutorial so I listen for the RCPT command. ... can read the recipient from the command. ... not, of course, want the server to completely drop the session and my other ...
    (microsoft.public.exchange2000.admin)
  • Re: Protocol Event sink
    ... > Peter, thank you very much for the reply. ... > It's too bad you can't get the server to ignore a command. ... > waiting for a response, but a response could easily be an error code. ... recipient specification command (i.e. the recipient will not be added to the ...
    (microsoft.public.exchange2000.development)
  • Re: Protocol Event sink
    ... > Peter, thank you very much for the reply. ... > It's too bad you can't get the server to ignore a command. ... > waiting for a response, but a response could easily be an error code. ... recipient specification command (i.e. the recipient will not be added to the ...
    (microsoft.public.exchange.development)
  • Re: Secure Form Script?
    ... > Also, what if you call sendmail directly, but quote it wrong? ... Directly executing anything is a big risk no matter how you ... the only thing going to the command line is the ... recipient -- and I'm presuming that that is fixed. ...
    (Focus-Linux)