In an Office 365/Exchange environment it is possible to have many email aliases associated with your account and receive email on all of those addresses.
However sometimes it can be useful to determine which of those email addresses was used when the message is received and this information is not presented by default.
One way to achieve this is to use a transport rule on the message to modify the message in some way as to make the email address that the message was sent to easily identifiable.
Create an additional email alias to receive the mail
The first step in this process is to ensure the mailbox that you are going to be sending the message to has got an additional email address that you want to receive messages on. I used “email@example.com”.
Once you have created the alias and ensured you can receive email on it we can create the transport rule which will enable us to identify when messages are sent to that address.
Create an Office 365 Transport Rule to modify the message subject to make it identifiable
The next step is to create a transport rule to examine the message header so that the subject is modified to make the alias that the email was sent to easy to recognize.
- Login to your Office 365 Admin portal and go to Exchange administration.
- Go into the “Mail Flow” section.
- Click the add button and select the option to create a new rule.
- The new transport rule window will be displayed.
- Give your transport rule an appropriate name
- Click the “more options” link at the bottom of the window.
- Under the “Apply this rule if…” option, select “A message header…” and then “Matches these text patterns”
- Click on the “Enter text…” link and and enter the word “to” (without brackets) in the specify header name field and click OK.
- Click on “Enter text patterns…” and enter the email address for the messages that you are trying to identify and click the plus symbol to add it, then click “ok”.
- From the “Do the following” menu option choose “Prepend the subject of the message with…”
- Enter the text that you would like prepend to the message subject line. e.g.
- Add any additional conditions that you would like to apply and then click “ok”.
- Save the transport rule.
- Send an email to the address that you are trying to identify and you should see that the subject line has been amended to reflect your newly created rule.
You may find that when you send an email to the specified address immediately after creating the rule that it is not applied. I found that I had to wait for a few minutes before it started working.