开发者

Get Exchange Receive Connector name for messages traversing thru the Transport pipeline

I need to create a SMTP Receive Agent for the Transport Service in Exchange 2010 Hub Transport Server. What it would do is to add a custom header to any incoming messages according to which Receive Connector they come into. Say I have three configured receive connectors (1. default: port 25; 2. custom port 26; 3. custom port 27). I've figured out how to add the custom header to the message as they come in, but couldn't seem to find the way to identify which connector a given message comes from. Is that even programatically possible? Btw, I used C# and h开发者_JS百科ave gone thru the documentation of Exchange 2010 SP1 Transport Agent SDK. Maybe I missed something.


After getting a pointer from my colleague, I finally found what I had to do to resolve this. Basically there are two useful properties (Address and Port) in EndOfDataEventArgs .SmtpSession.LocalEndPoint class that indicate which receive connector a message comes from. As long as you configure your custom connectors with unique IP addresses and/or port#, you can capture this information when the EndOfData event is triggered.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜