0

Good Afternoon,

I have exhausted my googling and best-guess ideas, so I hope someone here has an idea of whether this is possible or not.

I am using Exchange Server 2010 (vanilla) in a test environment and trying to create a Hub Transport Rule using the Exchange Management Console. The requirements of the rules filtering are similar to the following scenario:

1.) If a recipient's address matches (ends with) "@testdomain.com" AND (begins with) "john"

2.) If the sender's address matches (ends with) "@testdomain.com"

3.) Copy the message to the "SupervisorOfJohns@testdomain.com" mailbox

I have no problems doing items 2 and 3, but I cannot figure out how to get item 1 in the same condition. I have come across some threads that simply concluded that MS goofed on this, but I am hesitant to fault them for something which seems like it should be really straightforward. I must be missing something. Expressions I have tried so far...:

1.) (^john)(@testdomain.com$)

2.) ^(john)(@testdomain.com)$

3.) (^john)@testdomain.com

4.) ^john @testdomain.com$

5.) ^(john)@testdomain.com

If you use the interface and +Add them as two separate entries, it treats them as an OR clause (if a recipient address begins with "john", OR it ends with "@testdomain.com"). As you can see from my simplistic attempts, I have barely any clue what can/should work in this case. Any suggestions or ideas would be appreciated.

Respectfully,

B. Whitman

B. Whitman
  • 11
  • 1
  • The second rule covers your first one. – hjpotter92 Jul 09 '14 at 18:07
  • Thanks for the reply, but I believe the second one applies to the sender, whereas the first condition covers applying two rules to a given recipient. – B. Whitman Jul 09 '14 at 18:14
  • How do you differentiate b/w recipient and sender? – hjpotter92 Jul 09 '14 at 18:16
  • In the interface (Exchange Management Console), there are checkboxes for various conditions you want to check for a rule, before performing whatever action. The two conditions I have checked are: if a recipient address matches an expression, and if the sender address matches an expression. – B. Whitman Jul 09 '14 at 18:21
  • then use the pattern: `(john)?\w*@testdomain.com$` – hjpotter92 Jul 09 '14 at 18:29
  • I got really excited when it worked, but then it also copied e-mails sent from "jim@testdomain.com" to "SupervisorOfJohns@testdomain.com" – B. Whitman Jul 09 '14 at 18:43
  • When you want to match recipient as `john`, use `john@testdomain.com`; and checkbox only the specific condition. When you want to match senders `\w+@...` would work. – hjpotter92 Jul 09 '14 at 18:45
  • I understand what you are suggesting. I was trying to make a rule that would match "johnsmith@testdomain.com", "johnjones@testdomain.com" etc., and have those e-mails copy to the supervisor mailbox, when the sender and recipient are from potentially different domains. What I am going to do in the meantime, is have the service I'm writing do the latter bit of processing (ensuring the sender/recipient is in whatever domains required). Thank you very much for the feedback! – B. Whitman Jul 09 '14 at 19:19
  • Hey, I will post an answer in a bit, but your previous post gave me an idea, which I tried and it worked: "john\w*@testdomain.com" does exactly what I need to, for the first condition I requested. Thanks for the suggestions, as they certainly helped me find the answer. – B. Whitman Jul 09 '14 at 19:30

1 Answers1

0

Here's what I ended up using:

john\w*@testdomain.com

The reasoning behind the question is that I'm trying to make a service to catch certain e-mails and do some processing with them. I also wanted to restrict the senders/recipients to certain domains (though some checking will also be done with the processing service). Thanks to hjpotter92 for his solutions!

B. Whitman
  • 11
  • 1