Link to home
Start Free TrialLog in
Avatar of YMartin
YMartin

asked on

Exchange 2010 Transport rule to restrict recipients

We have some reports which are emailed.  We have a transport rule which searches the attachment for a phrase only found in these attachments.  

I have an exception which allows the report to be sent to certain email addresses.  The action sends a rejection message if additional recipients are included.

The problem is that while incorrect recipients are blocked they are not removed from the message header sent to approved recipients making it appear as if the email was sent to unauthorized recipients.  I would prefer to have all recipients blocked rather than sending misleading header information.

Is anyone familiar with a solution for changing the behavior of the transport rule to either alter the header information or block all recipients?

Exchange appears to be checking each separate instance of the email (one per recipient) against the transport rule as opposed to checking the entire email as a whole.  As there may be no way around this is there a way to use the message header pattern match in order to reject all recipients except for a specific header with correct recipients or otherwise alter the exceptions?
Avatar of Manikandan Narayanswamy
Manikandan Narayanswamy
Flag of India image

Hi,

I don't think in Exchange 2010 has any transport rule which can modify the message headers and remove the unauthorized recipients. Also there is no specific rule which can look for specific message header pattern in order to reject all recipients except for specific header with correct recipients

https://technet.microsoft.com/en-us/library/bb124703%28v=exchg.141%29.aspx?f=255&MSPPError=-2147217396

Thanks
Manikandan
Hi,

However you can use the regular expression in transport rules for to match text patters in different part of message. Check the below link

https://technet.microsoft.com/en-us/library/aa997187(v=exchg.141).aspx

Thanks
Manikandan
Avatar of YMartin
YMartin

ASKER

Thanks for the response.

I have tried to use the header pattern match for the "To" field as a rule exception.  I attempted various combinations of ^user@domain.tld$, ^User Name <user@domain.tld>$ etc.  in order to only allow emails with a single recipient specified in the rule however I have been unable to get a match on the correct header (single recipient only) despite matching the header shown in the NDR.

It was my intention to nest rules to allow only empty CC header, then single recipient To header.
Hi,

Like i said there is no rules action in Exchange 2010 to filter the message header its just not possible

Thanks
Manikandan
Avatar of YMartin

ASKER

I do understand I cannot remove items from the header but I should be able to use the header content as an exception to a rule.  Is there no rule exception possible based on the header?

For example:
Set-TransportRule -Identity 'Test' -Name 'Test' -Comments '' -ExceptIfHeaderMatchesMessageHeader 'To' -ExceptIfHeaderMatchesPatterns 'user@domain.tld'

Open in new window

Hi,

Please refer the below link and see if you're setting the rules like this

https://technet.microsoft.com/en-us/library/aa998315(v=exchg.141).aspx

Thanks
Manikandan
ASKER CERTIFIED SOLUTION
Avatar of Manikandan Narayanswamy
Manikandan Narayanswamy
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YMartin

ASKER

Thanks.  I did get the header field to match but "^User Name$" does not prevent additional recipients from being included in the "To" header field.  Looks like I cannot improve this any further.  Appreciate the assistance.