[E2013][C#][Windows] Reliably identify sender in SmtpReceiveAgent RRS feed

  • Question

  • I use Exchange 2013 (847.32 for mailbox and 913.22 for CAS) as a simple SMTP server and I want to take specific actions depending on who the sender is.

    I made a connector which allow basic authentication (auth login) and a SmtpReceicveAgent.

    I tried to retrieve the logged user in the code of my connector with no luck, the only thing I can get is the mail properties like FROM which is not reliable. I looked at all events available but it seems that any of them gives me the user's login.

    For reference, here is mdsn's page about these events. Most of them gives the SmtpSession object in the args but it doesn't help.

    I also gave a try to OnEndOfAuthentication event which has a property "RemoteIdentityName". However it returns "CAS01" which is the name of a Client Access Server.

    any clue on how to determine the login of the user currently sending the mail.

    Thursday, September 25, 2014 7:46 AM


  • uninstalled the SmtpReceiveAgent from the mailbox server and installed it on the Client Access Server instead and now the given "RemoteIdentityName" is correct.
    • Marked as answer by Luke Marlin Thursday, September 25, 2014 9:14 AM
    Thursday, September 25, 2014 9:14 AM