Outlook – How to change the From: field in an email’s header using Outlook or Exchange online

emailexchangemicrosoft-outlookoffice365

I have been tasked with automating a process: getting GMS email alerts to automatically create tickets in ConnectWise, AND automatically assign the proper client.

In our environment we have a SonicWALL GMS that sends out email alerts. The GMS monitors 20 different SonicWALLS for 20 different clients.

The alerts are sent from sender@domian.com.
The emails are sent to a distribution group gmsalert@domain.com.
In this distribution group is the member ticketingsystem@domain.com. When an email is received by ticketingsystem@domain.com, a ticket is automatically created in our ticketing system. This mail flow is working properly, no problems there.

Here's the challenge: in order to get the ticketing system to automatically select the company field for the company, the FROM: field needs to be a company contact. For example: gms@clientX.com

What I need is a rule that can change the from email address: sender@domain.com to a client contact email address gms@clientX.com, based on the SonicWALL serial number in the subject or body of the email. I don't need to redirect the email, I can get it TO the right place, I just need to change where the email is FROM, so the ticketing system assigns the correct client

I have researched this extensively. I've tried Outlook rules, but can't find one that will "send as" a different user. I have researched Exchange mail flow rules that adjust message header information, even opened a ticket with Office 365 support, and they hit a dead end as well. Does anyone have any insight on how to change the From: field in an email's header using Outlook or Exchange online?

*************EDIT***************
For clarity I have added a diagram that shows the flow and what needs to happen. The To: field does not need to change. The emails are being delivered to where they need to go. When they get to where they are going, the From: field needs to change.

mail flow diagram

Best Answer

This isn't something that is available in unmodified Exchange, much less Outlook. I have accomplished the exact same thing in two ways.

1) We use IronPort ESA filters/SMTP nodes to accept mail. You can write a rule at this level to do what you are asking before delivering to Exchange. The idea is simple enough and many mail filters will have similar capabilities. Have a mail content rule that triggers if the sender is 'GMS' and body contains serial number 'xyz' (lots of rules, one for each SN); the action is to modify the envelope-sender address to your desired address. Do be wary that you are talking about modifying to an address with a domain that is sounds like you don't control. Depending on where in the process your filter performs sender verification & anti-spoof/spam your alteration of the from address may cause failures to deliver. Just be mindful that there may be additional changes this requires.

2) I have written a custom SMTP Mail Transfer Agent in .Net, my code was to strip & re-route attachments (we didn't want large attachments living in our Exchange server, so the ESA would send emails over a certain size to my MTA that would move the attachments to a file server and insert links to the offloaded files into the message body). You can do the same thing, get a custom MTA that reads the body and changes the from address based upon some lookup information. "If SN matches devices.SN then set From as devices.ContactEmail" type process. You'll need someone to do the coding for you (assuming that isn't in your skillset, if it is, boom, you're all set). Then your MTA just hands the re-written output to the Exchange inbound connector.

No, you can't do this in native Exchange (and especially in Exchange Online, where changing FROM address to non-authoritative domains is a pretty frowned upon thing). But it can be done.

Related Question