Link to home
Start Free TrialLog in
Avatar of Svet Paperov
Svet PaperovFlag for Canada

asked on

Exchange 2010 Transport Rule BCC of message sent to specific accepted domain

Hello,

I need some help with the transport rules.

We have Exchange 2010 (Hub, CAS, Mailbox on the same machine) with the following setup:
- Two accepted domains: domain1.com and domain2.com.
- All users have addresses in domain1.com, for example: user1@domain1.com
- Some users have addresses in domain1.com and domain2.com, for example user2@domain1.com and user2@domain2.com. However, the Primary SMTP Address is always in domain1.com, user2@domain1.com for example.

I am trying to configure a transport rule that does Bcc of all messages sent to @domain2.com regardless of the user but it doesn’t seem to work. For example:

New-TransportRule -Name "Bcc domain2" -RecipientAddressContainsWords '@domain2.com' -BlindCopyTo 'mailadmin@domain1.com'

will catch messages only if the Primary SMTP Address of the recipient is in @domain2.com. But if is in @domain1.com, this transport rule will not catch the message.

I’ve also tried different variations of the same rule, with reg. expressions for example but it doesn’t seem possible.

Is there are any other way to achieve the same goal?
Avatar of Akhater
Akhater
Flag of Lebanon image

another way to look at it is to add all these users to a distribution group and change your rule to sent to members of distribution group
of course the distribution group could be dynamic somehting like

New-DynamicDistributionGroup -Name "All domain2 Users" -Alias "AllDomain2Users" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (EmailAddresses -like 'smtp:*@domain2.com'))}

Open in new window

Avatar of Svet Paperov

ASKER

Hello @Akhater,

Thanks for your help.

I’ve already thought about using a distribution group but it won’t work: it would catch messages sent to both domains @domain1.com and @domain2.com and not messages sent to @domain2.com only.

However, I gave a try of your second suggestion about using dynamic distribution group. The Cmdlet correctly populates (with a small modification) the group with users having @domain2.com as an address but the transport rule, created using this distribution group (condition: “Sent to a member of distribution list”) filters messages sent to both @domain1.com and @domain2.com domains.

I need to catch messages sent to @domain2.com only and not to @domain1.com.

Thanks again  

The correct syntax for the cmdlet (skip smtp in EmailAddresses):
New-DynamicDistributionGroup -Name "All domain2 Users" -Alias "AllDomain2Users" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (EmailAddresses -like '*@domain2.com'))}

Open in new window

oh sorry you are perfectly that's the price of replying late at night !

do you have any kind of mail relay or anti-spam before your exchange box?
Yes, we have a hosted Google Postini but there is no much to do there and it does not rewrite the address.
well I was thinking maybe your antispam can add a custom header or something
ASKER CERTIFIED SOLUTION
Avatar of Svet Paperov
Svet Paperov
Flag of Canada 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
wow !

good to know there is a way for that

thanks for sharing
Found the answer myself