My SmtpReceiveAgentFactory project. Recent Exchange 2016 updates have changed behavior.

Brad Smith 1 Reputation point
2021-09-27T22:23:45.497+00:00

I have a fairly old custom TransportAgent project running on my in-house Exchange 2016. It's based off the samples for .NET-based SmtpReceiveAgentFactory samples, and has been running flawlessly for years. But at some point I assume a CU to Exchange 2016 (I'm running latest now) caused some behavior change. I'm hoping others with TransportAgents may have some thoughts.

In a nutshell, I register my agent, I see my SmtpReceiveAgentFactory-derived object gets created, and then CreateAgent is fired. Here's where things go awry. Previously, CreateAgent would be called once (passing in the SmtpServer), I'd use that to create my new SmtpReceiveAgent-derived object, and that Agent would get the events I register for. Eventually, the AgentFactory.Close would be fired, and I'd clean up.

Now, CreateAgent gets fired multiple times. Twice rapidly when the actual Transport Service starts, and then randomly about once per day another two will fire. But Close never fires unless I stop the Service (and then only once).

Because my Agent connects with a Windows Service, and there are no "cleanup" events firing, things go awry.

Again, this was working flawlessly for years, on multiple Exchange versions with minor updates with each major Exchange upgrade, but one of the fairly recent CUs changed something.

Anybody else dealing with this?

Brad.

Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
508 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,349 questions
0 comments No comments
{count} votes