Sample Exchange 2007 transport agent - add the name of the group to subject line
Published Jun 25 2008 03:34 PM 6,962 Views

Many people use rules to automatically sort messages from various distribution lists into folders in order to keep the volume of email traffic in their inbox to a manageable level. This works for the most part - until someone decides to BCC a list. Since the distribution list isn't visible in the list of recipients, it bypasses all rules and gets dropped in their inbox. This can cause quite a distraction for everyone on that DL because something appeared in their inbox, and it's not quite apparent why they received that message.

Mailman and Majordomo have had this problem solved for a while now. It's actually a very simple solution: make sure the name of the mailing list is included in the subject of the email. Then users can set up filters based on words in the subject and they never encounter the problem when someone BCC's the list.

Exchange 2007 can do the same thing; it just needs a little help from a custom transport agent. I have written a very basic agent to add the name of the DL into the subject. You can use it as a starting point and add your own features.

To install this agent, follow these instructions:

  1. Copy ShowDLInSubjectAgent.dll to your transport server. In this example, I place it in C:\MyAgents
  2. Open the Exchange Management Shell
  3. Type Install-TransportAgent -Name ShowDLInSubjectAgent -TransportAgentFactory ShowDLInSubjectAgent.ShowDLInSubjectFactory -AssemblyPath C:\MyAgents\ShowDLInSubjectAgent.dll
  4. Close and restart the Exchange Management Shell.
  5. Type Enable-TransportAgent -Identity ShowDLInSubjectAgent
  6. Restart the transport service by typing Restart-Service MSExchangeTransport

If all goes well, all emails to a distribution list will now include the name of the DL in the subject of the email.

Note: This is a sample transport agent and it is not officially supported by Microsoft. Please see the readme.txt file included in the package for more information.

The ZIP file with the binary and the entire source for you to play with is here:

ShowDLInSubjectAgent.zip

- Jesse Weigert

8 Comments
Version history
Last update:
‎Jul 01 2019 03:38 PM
Updated by: