Please help - Exchange Sink ignore command

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


Date: Sat, 18 Sep 2004 13:38:40 +0200

Hey all,

I sincerely hope someone can help me with this problem. I asked this in
multiple newsgroups and forum but nobody seems to know?

Anyway, I wrote an Event Sink, using the shieldsup tutorial
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp)
which helped me in the right way.

I changed the tutorial so I listen for the RCPT command. This works ok, I
can read the recipient from the command. If the recipient has a certain
value, I want the email not to be send to that recipient. This works ok for
one recipient - I can throw a COMException and the server will terminate the
session. However, if I would send an email with multiple recipient, I do
not, of course, want the server to completely drop the session and my other
recipient wouldn't get the mail either. So, basically I do not know how to
ignore a command. I tried the following:

- Setting the CommandStatus, for example: Context.CommandStatus = (uint)
ProtocolEventConstants.EXPE_COMPLETE_FAILURE; or EXPE_S_CONSUMED, but it
won't ignore the command, the RCPT TO: command is still processed and the
recipient will still recieve the email.
- Throw COMException, but that always (?) terminates the session, and as I
said before, I don't want that!
- 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 tell the SMTP server to ignore a command so the
recipient will be discarded? I've been struggling with this for 2 weeks !
now and no luck so far :(
Thanks in advance,

Razzie



Relevant Pages

  • 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)
  • Exchange Sink - discard recipients in email
    ... using ISmtpInCommandSink. ... I listen for the RCPT command, and I can read the recipient from the command ...
    (microsoft.public.exchange2000.development)
  • Re: VB SENDING E-MAIL THROUGH OUTLOOK
    ... 'Open up a frmemail.MAPI session: ... 'replace the first character in the MsgNoteText. ...
    (microsoft.public.vb.general.discussion)