Exchange 2010: Prevent Transport Rule applied to distribution group from listing all users in the list

exchange-2010groups

We have Exchange 2010. Say I am trying to prohibit users from including large attachments on internal distribution groups. I have set up a transport rule that is something like the following:

Apply rule to messages

from users that are 'Inside the organization'

  and when any of the recipients in the To or CC fields is
  'internal-list@contoso.com'

and when the size of any attachment is greater than or equal to 
'10 KB (10,240 bytes)'

send 'No attachment for you!' to sender with '5.7.999'

except when the Subject field or message body contains 'allow-attachment'

The result a user gets when this rule is triggered lists every member of the distribution list. First it lists the enhanced DSN text, and then it lists the custom message below that. For example, if abby, bashir and caroline are the members of the mailing list in question, Exchange generates a bounceback like this:

abby@contoso.com
Your message wasn't delivered because the recipient's e-mail provider rejected it.

bashir@contoso.com
Your message wasn't delivered because the recipient's e-mail provider rejected it.

caroline@contoso.com
Your message wasn't delivered because the recipient's e-mail provider rejected it.

Diagnostic information for administrators:
Generating server: mail.contoso.com
abby@contoso.com
#550 5.7.999 No attachment for you! ##
bashir@contoso.com
#550 5.7.999 No attachment for you! ##
caroline@contoso.com
#550 5.7.999 No attachment for you! ##

The problem is that the distribution group 'internal-list@contoso.com' is expanded in the message the end-user receives. I want the bounceback to eliminate the redundant information, and be more like:

internal-list@contoso.com
Your message wasn't delivered because the recipient's e-mail provider rejected it.

Diagnostic information for administrators:
Generating server: mail.contoso.com
internal-list@contoso.com
#550 5.7.999 No attachment for you! ##

but I cannot figure out how to do this (or produce something simpler that would just give the user advice about attachments). I have tried changing the condition

  and when any of the recipients in the To or CC fields is
  'internal-list@contoso.com'

to various other criteria that should match the internal list (for example, matching the "To" header in the email), but I have not found anything that works. I guess I do not understand why I can create the rule that applies to the unexpanded distribution list, but the rule appears to be applied after the distribution group is expanded.

Do you know how I can massage this rule to give a simple bounceback? Or is there a different solution that does not involve transport rules?

Best Answer

The only way I can think of for you to get what you want here is to use an intermediary account, since distribution lists will work exactly as you described.

What I mean is, setup a mailbox called "Internal List" and change your distro list to "Distro list of Internal List" and hide that distro list from the Address Books. Give "Internal List" mailbox the SMTP address that Distro list currently has and use that in your Transport Rule.

Then set the Internal list to always forward email to the distro list.

This would give you the desired effect.

HOWEVER, you then have to deal with 2 things:

  1. Instructing users that this "mailbox" is the "distro list" (the icons would look different)
  2. You wouldn't be able to manage the distro list from Outlook since it will be hidden, so if you currently have a manager or someone that can modify the distro recipients, you'd now have to handle that on the Exchange side.

All that said...if there's a way to handle this programmatically I don't know what it is...but I've seen some wild things done with the Exchange APIs from 3rd parties in the past. Maybe someone out there has a way to create a custom DSN like you need without going through the above, but that's quick and easy.

Related Topic