Microsoft Exchange – Forwarding Mail To External Email Addresses

KB ID 0001350 

Problem

Note: Below I’m using Exchange 2016, but the same approach will work for previous versions.

There are a load of reasons why you might want to do this, but before you go off in this direction consider why you are doing this in the first place. For example, if the user requesting this does not need an Exchange mailbox, i.e. because they only use their Gmail account then it’s probably a better idea to make them a mail-user. (That’s an AD user account, that has an external mailbox, and does not have an Exchange mailbox). For staff e.g. external contractors, part time staff, holiday cover staff, Mail-users might be a better fit.

If you are still reading you have a user with an Exchange mailbox, and you want to forward their email to an Email address outside your organisation, there are many ways of enabling forwarding, but fundamentally there’s only two things to consider;

  1. Do you still want mail to get delivered to their Exchange mailbox while forwarding?
  2. What is the external Email address you want to forward to?

Armed with this information you can decide what approach you want to take to achieve this.

 

Solution

Option 1: Get The User to Set Up Mail Forwarding in OWA

The best option for the lazy admin! “Oh, are you aware you can set this up yourself?” Even give them this URL as a walkthrough if you like 🙂

From within Outlook Web App open your ‘Options’

OWA Options 2016

Mail > Inbox and Sweep Rules > Inbox Rules > Add

Note: On older versions of OWA look in Organize email > inbox rules > Add.

OWA Inbox Rules

Give the rule a name > Set to [Apply to all messages] > Forward Redirect or Send > Forward Message To.

Note: Setting Redirect instead of Forward will NOT keep a copy in you local Exchange Mailbox.

OWA Forward Mail Rule

Enter the external email address to forward to > Save.

 OWA Forward Mail To External Address

OK.

2016 Forward Mail To External Address

Option 2: Enable Mail Forwarding In Exchange Admin Center

To forward mail externally for an ‘Exchange Mailbox User’, you need to create a ‘Contact’. A contact is an active directory object (not a user) that has an email address (in our case the external one). Log into Exchange Admin Center > Recipients > Contacts > Add > Mail Contact.

Exchange 2016 Forward Mail To External Address

Create a contact and give it a sensible name (so when it appears in the Global Address List it’s obvious what it is*)

*Note: You can hide them from the GAL if you like, with the following PowerShell;

Set-MailContact ALIAS-NAME -HiddenFromAddressListsEnabled $true

Exchange 2016 Mail contact

On the Mailbox Tab, locate the user you want to setup forwarding for, and edit them.

Mailbox Features > Scroll Down to ‘Mail Flow‘ > View Details > Tick ‘Enable Forwarding‘ > Browse to the CONTACT you created earlier > OK.

Note: You may also want to select “Deliver message to both forwarding address and mailbox”.

Exchange 2016 Enable Forwarding

Option 3: Setup Mailbox Forwarding With PowerShell

There’s a lot of rubbish written about this online, sites give you a line of PowerShell to paste in and it does not work, because there’s other things you need to do to make this work.

Example 1: Couldn’t find object “pete@externaldomain.com“. Please make sure that it was spelled correctly or specify a different.. 

If you setup mail forwarding using the ExternalEmailAddress you need to CREATE A CONTACT FIRST! Or you see the error above.

To Setup External Forwarding and Keep a Local Copy of the Email

Execute the following commands;

New-MailContact -Name Pete.Long-External -ExternalEmailAddress pete@externaldomain.com 
Set-Mailbox -Identity “Pete.Long” -DeliverToMailboxAndForward $true -ForwardingAddress pete@externaldomain.com 

Note: It’s the ‘$true‘ that maintains the local copy.

Exchange 2016 PowerShell Enable Forwarding

To Setup External Forwarding and Keep and NOT keep Local Copy of the Email

Execute the following commands;

New-MailContact -Name Pete.Long-External -ExternalEmailAddress pete@externaldomain.com 
Set-Mailbox -Identity “Pete.Long” -DeliverToMailboxAndForward $false -ForwardingAddress pete@externaldomain.com 

Note: It’s the ‘$false‘ that does not maintain the local copy.

Exchange 2016 PowerShell Enable Forward ALL

What about ExternalSMTPEmailAddress?

OK there’s another parameter you can set, it’s called ExternalSMTPAddress when you set this you DON’T NEED A CONTACT. This sounds great and again theres a load of blog posts that give you the PowerShell to set this for a user AND IT DOES NOT WORK!

Note: If you setup mail forwarding using this method the forwarding address is NOT VIEWABLE IN THE GUI, if you have enabled keep a local copy, that IS viewable.

Example 2 : My ExternalSMTPAddress Forwarder is not working?

This is because what other sites don’t tell you is unless you specified the target domain (for the remote email address), as AutoForwardEnabled it has a habit of not working! 

See Below to setup Mail forwarding with ExternalSMTPAddress properly.

To Setup External Forwarding and Keep a Local Copy of the Email

Execute the following commands;

Set-Mailbox -Identity “Pete.Long” -DeliverToMailboxAndForward $true -ForwardingSMTPAddress pete@externaldomain.com
New-RemoteDomain -Name ExternalDomain -DomainName externaldomain.com
Get-RemoteDomain ExternalDomain | Select DomainName, AutoForwardEnabled 

Note: It’s the ‘$true‘ that maintains the local copy.

Exchange 2016 PowerShell Enable Forwarding SMTP

To Setup External Forwarding and Keep and NOT keep Local Copy of the Email

Execute the following commands;

Set-Mailbox -Identity “Pete.Long” -DeliverToMailboxAndForward $false -ForwardingSMTPAddress pete@externaldomain.com 
New-RemoteDomain -Name ExternalDomain -DomainName externaldomain.com 
Get-RemoteDomain ExternalDomain | Select DomainName, AutoForwardEnabled  

Note: It’s the ‘$false‘ that does not maintain the local copy.

Exchange 2016 PowerShell Enable Forwarding SMTP ALL

Removing Mail Forwarding For a User

I wont insult your intelligence and tell you how to do this in the GUI just reverse engineer the above, but if you used ForwardingSMTPAddress you wont see it in the GUI! To remove ALL forwarding for a user, use the following command;

Set-Mailbox -Identity “Pete.Long” -DeliverToMailboxandforward $False -ForwardingSMTPAddress $Null -ForwardingAddress $Null

Showing Which User(s) Have Email Forwarding Enabled

Use the following commands;

Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, UserPrincipalName, ForwardingAddress, DeliverToMailboxAndForward
OR /AND
Get-Mailbox | Where {$_.ForwardingSMTPAddress -ne $null} | Select Name, UserPrincipalName, ForwardingAddress, ForwardingSMTPAddress, DeliverToMailboxAndForward

Show Email Forwarding for a Single User

Use the following command;

Get-Mailbox Pete.long | fl name,forwardingSMTPAddress,delivertomailboxandforward

 

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

6 Comments

  1. Is there a way to forward a single users email to an external email with the following conditions:
    M-F 10pm – 7am
    Weekends
    certain holidays

    Im wondering if I need a VB script on the local Outlook client.
    I had a third party service installed on my exchange box that was successfully forwarding with those conditions but the external email party went to 365 and now the forwarded email is seen as spoofing.

    Post a Reply
  2. Hi,

    I don’t know what I’m doing wrong, but I can only go with option 1. I need to sets some rules based on dates to redirect email to the right person based on the week. It’s for an Emergency repair service. Each employee has a week of duty.

    I want to redirect the email to the tech’s email (internal) and also send it to SMS, using mobile@sms.service.gateway.com.

    Right now, it will only work with the internal email, it never send it to the external email (I’ve tried Gmail, Hotmail… not working)

    The main email is not an active AD user, it’s an account just for that purpose.

    I also notice Redirect or Forward do the exact same thing, in my case Redirect did leave a copy of the email in the mailbox ?!?

    Since we can setup lots of rules, I can setup months ahead and a “normal” user can connect and change the dates in the rules. No need to have an Admin account given to a low level employee to go in the ECP to manage weekly the email forward to a contact.

    Any help is appreciate. Thanks.

    Post a Reply
  3. Just want to say thanks for this. You were the only website that mentioned that the SMTPForward would not work without a Remote Domain set up! Now if I could just have those hours of troubleshooting back…

    Post a Reply
    • Thanks Mike, Typically the articles here are for problems I’ve had, or helped with. (At the very least I test them in anger before I publish them). Glad I could help you out

      P

      Post a Reply
  4. Hi,

    Good tips. I have a question regarding exchange online but still in the subject. I recevie external mail to shared mailbox that I forward to external mail contact which works just fine. Now some inventive stake holder wants to make a new flow: external mail to shared mailbox->If sender is domain contoso.com forward/redirect to other internal shared mailbox and then forward to external mail contact. It reaches second shared mailbox but then halt.

    Log says Failed (Reason: [{LED=250 2.1.5 RESOLVER.MSGTYPE.AF; handled AutoForward addressed to external recipient};{MSG=};{FQDN=};{IP=};{LRT=}])

    Is this flow possible at all?
    *banging my head

    Kindly /Dan

    Post a Reply
  5. Hi Pete,
    I want to forward an email to a contact but this email should look like it is coming from me.
    Here is my dilemma:
    A:Original sender
    B: Me
    C: Contact I want to forward the mail to.
    C does NOT accept emails from A. It only accepts emails from B.
    When I setup a forward rule on Exchange 2013, it forwards a copy of the original email. How can I setup a rule to forward all emails B receives from A to C with B’s email address?
    Thank you in advance

    Post a Reply

Leave a Reply to LaGet Cancel reply

Your email address will not be published. Required fields are marked *