• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Paris, France
  • 6. Bangalore, India
  • 7. Amsterdam, Netherlands
  • 8. San Francisco, CA
  • 9. Hong Kong
  • 10. Houston, TX

Monday, February 18, 2008

 

How to forward mail to an external email address

Posted by Bharat Suneja at 9:52 PM
In Exchange Server 2003, mail for a recipient can be forwarded to an alternate recipient by modifying the recipient's Delivery Options in ADUC | recipient -> properties | Exchange General tab.

If you need to forward mail to an external email address, you cannot simply type the address in Delivery Options. A (mail-enabled) Contact needs to be created in AD first, and Delivery Options modified to point to the Contact.

Exchange Server 2007: In Exchange Server 2007, these tasks remain the same. However, instead of using ADUC to accomplish them, you use the EMC or the shell (aka "EMS"). The new term for a Contact is MailContact.

1 To create a MailContact using the Exchange Management Console:

1. Expand Recipeint Configuration | Mail Contact
2. In the Action pane, click New Mail Contact
3. To create a new Contact object, leave the default (New Contact) selected | click Next
4. Type First name, Last name
5. Click Edit to add the external email address
6. Click New to complete creation of new MailContact

To create a new MailContact using the Exchange Management Shell:

New-MailContact -Name "Foo User" -ExternalEmailAddress "foo@externaldomain.com

Next, we set the recipient's Delivery Options to deliver to the alternate recipient.

2 To forward mail for a recipient to the MailContact using the Exchange Management Console:

1. Expand Recipeint Configuration | Mailbox | select mailbox | properties | Mail Flow Settings tab | Delivery Options
2. Under Forwarding address, select the Forward to checkbox
3. Click Browse to select the MailContact
Screenshot: Delivery Options -< Forwarding Address
Figure 1: Modifying Delivery Options to forward email to an alternate recipient

4. Optional: If a copy of the message needs to be delivered to both the external recipient and the original recipient's mailbox, select the Deliver message to both forwarding address and mailbox
5. Click OK to close Delivery Options properties
6. Click OK to close recipient's properties

Using the Exchange Management Shell:

Set-Mailbox "Joe Adams" -ForwardingAddress "foo@externaldomain.com"

To deliver a copy to the mailbox (in addition to the external email address - equivalent of step 4 above):

Set-Mailbox "Joe Adams" -ForwardingAddress "foo@externaldomain.com" -DeliverToMailboxAndForward $true

To get a list of mailboxes with forwarding enabled:

Get-Mailbox | where {$_.ForwardingAddress -ne $null} | ft name,forwardingaddress

Automatic forwarding and Remote Domains

Remote Domains are a bunch of settings, such as message formats, character sets, and OOFs, for messages sent to particular remote domains. The default Remote Domain setting applies to address space * - that is, all remote domains for which an explicit Remote Domain setting does not exist.

Screenshot: Remote Domain properties
Figure 2: The Allow automatic forward setting for remote domains impacts client-side automatic forwarding, and is disabled by default.

However, this setting only applies to client-side forwarding. For instance, if a user creates a rule in Microsoft Outlook to automatically forward mail to an external email address, the default setting does not allow it. To enable automatic client-side forwarding of mail to external addresses, select the Allow automatic forward checkbox in a remote domain's properties | Format of original message sent as attachment to journal report tab (Yes, the tab is mislabeled. It is the "Message Formats" tab... :).

Server-side forwarding setup by an administrator is not impacted by this setting.

Labels: , , ,

37 Comments:

February 19, 2008 5:42 AM
Blogger Murray Wall said...

Why not just modify the TargetAddress field in Active directory user with smtp:forwardingaddress@domain.com This will send all mail to this user bypassing the mailbox.

 
February 27, 2008 7:27 PM
Blogger Bharat Suneja said...

Afaik, simply adding the external email address to targetAddress attribute doesn't work. (Need to test further, but this is what the initial tests reveal).

It also doesn't help if you want to deliver to the addressed recipient *and* the alternate recipient (whether internal or external).

 
March 4, 2008 4:42 AM
Blogger Delboy said...

Can I use this to forward emails to a server and port number?

Will it show up with the original header information?

 
March 4, 2008 8:34 AM
Blogger Bharat Suneja said...

- Messages will be forwarded to the external mail host responsible for that domain/email address.
- This has no connection with message routing. Send Connectors determine how messages are routed to an external domain/address space.
- Yes, original headers are preserved.

 
April 30, 2008 1:44 PM
Anonymous Anonymous said...

is there a way to list the forwarding enabled accounts in 03?

similar to "get-mailbox"

 
August 12, 2008 7:26 AM
Anonymous Anonymous said...

Bharat
Would like to know whether there any options available for forwarding a copy of the send mails from a set of users to a monitoring account (Say administrator's email account). We need it to be done as discreet as possible to track the activities of certain sales executives who are believed as manipulating selling prices.
Scripts, third party tools which could be installed at the server side would be a great help for us.

 
August 12, 2008 10:17 AM
Blogger Bharat Suneja said...

@Anonymous: Which version of Exchange server?

You could use Journaling.
- In Exchange 2003/2000, Journaling is per Mailbox Database. You will end up journaling all mailboxes on the Database.
Overview of Exchange Server 2003 Journaling

- In Exchange 2007, you can journal selectively.
Overview of Journaling
How to Create a New Journal Rule

If you're on Exchange Server 2007, you can use Transport Rules to send a copy of messages to the desired recipient.
Overview of Transport Rules

On either version, you can assign Full Access permissions and access the mailbox using OWA or Microsoft Outlook.
HOW TO: Grant Full Mailbox Access permission

 
February 14, 2009 5:36 PM
Anonymous Anonymous said...

Well done!

 
March 18, 2009 10:52 AM
Anonymous Anonymous said...

How can I forward e-mail to more then two recepient?

 
March 18, 2009 10:57 AM
Blogger Bharat Suneja said...

@Anonymous from March 18: You can forward to a Distribution Group, and add the external recipients to the Distribution Group.

Note, to add external recipients to a Distribution Group, you need to create them as Contacts first.

 
March 18, 2009 11:17 AM
Anonymous Anonymous said...

Thanks Bharat, I am able to forward e-mail to more than two recipients.

 
April 22, 2009 11:25 PM
Anonymous Anonymous said...

MS Exhange Transport services is in STARTING status, any idea what might cause this exception. I restarted the server couple of times.

 
April 24, 2009 12:57 AM
Anonymous Harlekin said...

Hello, I have followed the instructions but still cannot get it to work.

I have selected the option to deliver message to both forwarding address and mailbox. When I send a test mail it arrives fine at the mailbox but doesn't get forwarded. Then, a minute or so later, a NDR shows up at the mailbox. It gives me the following error "#550 5.7.1 Unable to relay"

I have been scouring the net for a solution but haven't found anything. Do you guys have any thoughts?
(It's Exchange 2007 and we have a 2-server org with one internal and one front end)

Cheers

 
April 24, 2009 5:35 AM
Anonymous Anonymous said...

I followed the above but I'm getting NDR's with "#550 5.7.1 Unable to relay "

Any ideas? I'm using Exchange 2007 btw...

 
June 8, 2009 3:24 AM
Anonymous Anonymous said...

very nice article

 
July 23, 2009 8:11 AM
Anonymous claudio said...

In Exchange 2007 there is not Delivery Option in Mail Follow Settings under Mail Contact, there is in normal Contact...

 
August 11, 2009 3:15 AM
Anonymous Anonymous said...

Hi Bharat, nice article.

I have tried the forwarding to another recipient and it works fine.
But the forwarding to Distribution Group doesnt work if initial email was sent from external source.

'Received-SPF: None (my server name.my domain name)'
my email@yahoo.co.uk does not designate permitted sender hosts.'

Thanks

 
August 23, 2009 2:28 AM
Anonymous Anonymous said...

QUOTE "Hi Bharat, nice article.

I have tried the forwarding to another recipient and it works fine.
But the forwarding to Distribution Group doesnt work if initial email was sent from external source.

'Received-SPF: None (my server name.my domain name)'
my email@yahoo.co.uk does not designate permitted sender hosts.'

Thanks"



I am also gettting this error (Exch 2003) when forwarding from external emails and as smtp.enta.net will not relay emails from non authorised senders.

HAs anyone got a solution for this??

 
September 2, 2009 3:29 AM
Anonymous Mohan Reddy said...

Hi Bharat: Nice Article.

I am trying to implement the following on Exchange 2007 Hub Transport Rule :

The rule is as following:

From Users Inside the Organization
and Sent to Users Inside the organization
Redirect the message to External SMTP Address
and Silently drop the message.

I have tried to catch individual users and redirect to external SMTP address works but the Inside to Inside doesn't seem to work.

Any help is highly appreciated.

 
September 2, 2009 6:38 AM
Blogger Bharat Suneja said...

@Mohan Reddy: Can you provide more details of what you're trying to accomplish and what doesn't work? If I read the rule correctly, it shouldn't work.

 
September 3, 2009 2:12 AM
Anonymous Mohan Reddy said...

Hi Bharat, Thanks for your Reply.

I want to Redirect all the internal messages of domain ( i.e from user1@domain.com to user2@domain.com ) to an external SMTP address.

From Users Inside the Organization
and Sent to Users Inside the organization
Redirect the message to External SMTP Address
and Silently drop the message.

The above rule doesn't seem to work to accomplish the task.

 
September 15, 2009 12:34 PM
Anonymous Anonymous said...

How can I use this same command to do multiple users? This is good if you go user by user. If you want to setup mail forwarding for 100 users, it'll take awhile.

 
September 15, 2009 12:48 PM
Blogger Bharat Suneja said...

@Anoymous from September 15th: The shell is designed for automation and performing bulk operations!

You can get recipients such as mailboxes using Get-Mailbox (or corresponding Get-* cmdlet) and pipe to Set-Mailbox (or corresponding Set-* cmdlet). For example, for mailboxes in an OU: Get-Mailbox -organizationalunit "People" | Set-Mailbox -ForwardingAddress "foo@externaldomain.com" -DeliverToMailboxAndForward $true.

There are examples of this across many posts on this blog - for example, check Applying Managed Folder Policy to more than one user. You can get recipients/mailboxes by server, mailbox database, OU, etc.

Or use the -Filter parameter with recipient cmdlets to specify a filter. The properties you can use to filter are covered in Filterable Properties for the -Filter Parameter in Exchange 2007 SP1 and SP2.

Once you get the mailboxes you want to apply a change to, pipe them to Set-Mailbox.

If you haven't come across it already, I'd highly recommend reading Using the Exchange Management Shell in Exchange 2007 docs.

 
September 16, 2009 7:12 AM
Anonymous Anonymous said...

Thanks Bharat.

In my situation, I have mailbox users and also forwarding contacts made for those mailboxes. For example user@domain1.com needs to forward to user@domain2.com, user2@domain.com needs to forward to user2@domain2.com and so forth.

Can you please tell me the syntax i should use to perfom that operation?

I have 500 users I need to setup forwarding for since our company is breaking off of our parent company....so we need our email to forward.

 
September 24, 2009 6:54 AM
Anonymous Anonymous said...

Hello Bharat

I work for a small charity which has our own Exchange 2003 server.

We have some committee members and a Res Home for which we have set up users and contacts to enable them to give out email addresses with our domain name so we can collect them (check for virus and spam) then forward them onto their private email addresses.

I have set the users up to forward the mail to their contact which has the details of their private email.
When we send mail from internal users the mail gets routed correctly to them.
The problem comes when mail comes in from external sources, our Exchange server sorts it correctly then tries to send it out again but gets an NDR message saying that the smtp server we send it out via does not accept mail. (Error 5.5.0 521).

ie if our domain is (domain.org.uk)
mail from test@domain.org.uk to home@committee.com works
mail from test@domain.org.uk to com1@domain.org.uk is rerouted to home@committee.com OK
mail from stranger@external.com to com1@domain.org.uk is rerouted to home@committee.com but fails to be sent and NDR produced.

Any ideas how to allow this relay to take place (sorry, tries to explain as best as possible)

 
October 26, 2009 5:18 AM
Anonymous Anonymous said...

Any ideas how to forward mail from user@example.com to user2@example.com AND user3@example.com AND user4@example.com - can this be set with the Exchange PowerShell?

 
November 10, 2009 6:46 PM
Anonymous Anonymous said...

hi, i tried using the DL to forward mails to internal and external users. Only internal users receive the mail. what could have gone wrong? thanks

 
January 5, 2010 7:15 AM
Anonymous Anonymous said...

I am able to forward email to an address using Set-Mailbox with -ForwardingAddress. How can I UNFORWARD email using the command line?

 
January 5, 2010 7:25 AM
Anonymous Anonymous said...

I figured it out! Set-Mailbox -ForwardingAddress $nul

 
January 5, 2010 7:33 AM
Blogger Bharat Suneja said...

@Anonymous from Jan 5, 2010: You set forwarding address to null:
Set-Mailbox foo -ForwardingAddress $null

@Anonymous from Nov 10, 2009: Is auto-forwarding enabled for remote domains?

 
January 20, 2010 1:02 AM
Anonymous Anonymous said...

Hi Bharat

What about forwarding NDRs?
I configured forwarding to an internal distribution list. Everything works fine, except incomming non delivery reports. These NDRs are not forwarded to the distribution list. Is that behavior by design? Can I change that?

Regards
Peter

 
January 21, 2010 3:36 PM
Anonymous Anonymous said...

Hi Bharat,
we have space Quota for our user. so when mailbox is full server automatically bounce such emails with out notifying user.
i want to know whether it is possible that when server bounce an email, he also forward it to a special account?

Regards
Ralf

 
January 25, 2010 8:14 AM
Anonymous Anonymous said...

Hello,
the article says: "2. Under Forwarding address, select the Forward to checkbox".

How do I activate and deactivate this checkbox for "Foo User"? I would like to change just this checkbox, anything else shoud remain the same.

best regards
arno

 
January 27, 2010 12:29 AM
Anonymous Anonymous said...

Hello Bharat,

could you show how to enable/disable the "Forward to" checkbox using the Exchange Management Shell?

regards
arno

 
February 2, 2010 5:14 AM
Anonymous Anonymous said...

Hello Bharat,
sorry for posting twice, it just did not appear on the website fast enough :(

Can you demonstrate how to enable/disable forwarding using a script for Exchange 2003 (Active Directory)?

For Exchange 2007 it would be for disabling:
set-mailbox -identity jose@contoso.com -ForwardingAddress $null
enabling:
Set-Mailbox -Identity John -DeliverToMailboxAndForward $true -ForwardingAddress jose@contoso.com
(http://technet.microsoft.com/en-us/library/bb123981(EXCHG.80).aspx)

regards
arno

 
February 28, 2010 9:31 PM
Anonymous Anonymous said...

OK I've set up "Foo User" and the "forward" works fine, "Foo User" is also a member of a "Distribution Group" "All Foo Users". Will the "Forward" to "Foo User" also recognise that he\she is a member of "All Foo Users" and therefore "Forward" those emails also?

Thanks

 
March 14, 2010 9:39 PM
Anonymous Anonymous said...

Hi Bharath,

Very informative and nice post. I have Exchange 2003 and my requirement is that I'm able to forward to an external contact but I don't want to preserve the original message headers. For example, if user1@domain1.com's emails are forwarded to external mail contact user2@domain2.com then the mail headers show the mail was sent to user1@domain1.com. In fact instead of auto forward it should be like sending a copy of the mail to user2@domain2.com

Thanks & Regards

 

Post a Comment

Links to this post:

Create a Link

<< Home