HOWTO: Set SMTP status code from the SMTP protcol event sink? - Microsoft Exchange

This is a discussion on HOWTO: Set SMTP status code from the SMTP protcol event sink? - Microsoft Exchange ; Hi, I try to develop simple PROTOCOL event sink. What I need is that the sink would be able to set the status code and customized message which would be visible in email client program such as Outlook Express. What ...

+ Reply to Thread
Results 1 to 4 of 4

HOWTO: Set SMTP status code from the SMTP protcol event sink?

  1. Default HOWTO: Set SMTP status code from the SMTP protcol event sink?

    Hi,

    I try to develop simple PROTOCOL event sink. What I need is that the sink
    would be able to set the status code and customized message which would be
    visible in email client program such as Outlook Express. What is the right
    way to do that?

    Thanks.

    Renatas Lauzadis, MCSD.NET.





  2. Default Re: HOWTO: Set SMTP status code from the SMTP protcol event sink?

    Hi,

    Use pContext.SetSmtpStatusCode() and pContext.SetResponse().

    Peter

    "Renatas Lauzadis" <nospam@gmx.net> wrote in message
    news:OFdo1o3JEHA.268@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I try to develop simple PROTOCOL event sink. What I need is that the sink
    > would be able to set the status code and customized message which would be
    > visible in email client program such as Outlook Express. What is the right
    > way to do that?
    >
    > Thanks.
    >
    > Renatas Lauzadis, MCSD.NET.




  3. Default Re: HOWTO: Set SMTP status code from the SMTP protcol event sink?


    Thanks for reply.

    It works correctly in telnet but not in Outlook express.
    Context.SmtpStatusCode = Convert.ToUInt32(451)
    Context.Response = "451 4.7.1 SMTP session was blocked due to SMTP policy violation by IP " & cip
    Context.CommandStatus = Convert.ToUInt32(ProtocolEventConstants.EXPE_DROP_SESSION)
    Throw New COMException("Event is consumed", ProtocolEventConstants.EXPE_S_CONSUMED)

    The result that appears in OE is:
    Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Subject 'dsfsdfsdf', Account: 'SMTP testing', Server: 'mycomputer.companydomain.lt', Protocol: SMTP, Port: 25, Secure(SSL): No, Error Number: 0x800CCC0F

    What is the difference between OE porcessing and processing via telnet?

    P.S. I tried to use different error codes like 552 and so on.

    Renatas.

    "Peter Karsai (Vamsoft)" <welcome.home@[127.0.0.1]> wrote in message news:ObQ1iE4JEHA.3292@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > Use pContext.SetSmtpStatusCode() and pContext.SetResponse().
    >
    > Peter
    >
    > "Renatas Lauzadis" <nospam@gmx.net> wrote in message
    > news:OFdo1o3JEHA.268@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > I try to develop simple PROTOCOL event sink. What I need is that the sink
    > > would be able to set the status code and customized message which would be
    > > visible in email client program such as Outlook Express. What is the right
    > > way to do that?
    > >
    > > Thanks.
    > >
    > > Renatas Lauzadis, MCSD.NET.

    >
    >


  4. Default Re: HOWTO: Set SMTP status code from the SMTP protcol event sink?

    Hi,

    There is no difference between OE and telnet, it should work with both. I am
    not familiar with the .NET-ised framework of the IIS SMTP events, but any
    exception leaving the event sink COM server causes the SMTP Service to
    crash, so it is a bit weird for me (sure works in .NET). Try it without
    dropping the connection (without EXPE_DROP_SESSION), OE may consider this a
    more severe event than the SMTP reply and ignore the response code.

    Peter

    "Renatas Lauzadis" <nospam@gmx.net> wrote in message
    news:%23yKJhVcLEHA.3216@tk2msftngp13.phx.gbl...

    Thanks for reply.

    It works correctly in telnet but not in Outlook express.
    Context.SmtpStatusCode = Convert.ToUInt32(451)
    Context.Response = "451 4.7.1 SMTP session was blocked due to SMTP policy
    violation by IP " & cip
    Context.CommandStatus =
    Convert.ToUInt32(ProtocolEventConstants.EXPE_DROP_SESSION)
    Throw New COMException("Event is consumed",
    ProtocolEventConstants.EXPE_S_CONSUMED)
    The result that appears in OE is:
    Your server has unexpectedly terminated the connection. Possible causes for
    this include server problems, network problems, or a long period of
    inactivity. Subject 'dsfsdfsdf', Account: 'SMTP testing', Server:
    'mycomputer.companydomain.lt', Protocol: SMTP, Port: 25, Secure(SSL): No,
    Error Number: 0x800CCC0F

    What is the difference between OE porcessing and processing via telnet?

    P.S. I tried to use different error codes like 552 and so on.

    Renatas.

    "Peter Karsai (Vamsoft)" <welcome.home@[127.0.0.1]> wrote in message
    news:ObQ1iE4JEHA.3292@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > Use pContext.SetSmtpStatusCode() and pContext.SetResponse().
    >
    > Peter
    >
    > "Renatas Lauzadis" <nospam@gmx.net> wrote in message
    > news:OFdo1o3JEHA.268@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > I try to develop simple PROTOCOL event sink. What I need is that the

    sink
    > > would be able to set the status code and customized message which would

    be
    > > visible in email client program such as Outlook Express. What is the

    right
    > > way to do that?
    > >
    > > Thanks.
    > >
    > > Renatas Lauzadis, MCSD.NET.

    >
    >




+ Reply to Thread

Similar Threads

  1. Remote SMTP Event Sink ?
    By Application Development in forum Microsoft Exchange
    Replies: 1
    Last Post: 04-12-2005, 06:29 AM
  2. Register the SMTP event sink
    By Application Development in forum Microsoft Exchange
    Replies: 1
    Last Post: 09-24-2004, 12:50 AM
  3. EVENT SINK IN SMTP
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 07-29-2004, 11:51 AM
  4. Managed SMTP event sink
    By Application Development in forum Microsoft Exchange
    Replies: 2
    Last Post: 06-25-2004, 06:27 AM
  5. Re: SMTP Event Sink and NDR
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 02-26-2004, 04:55 PM