Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Our office uses both office 365 and Google apps. We were on Google apps first, and decided to give office 365 a try. Some folks liked it, some did not, and want to revert back to Google apps for mail.

We currently have our MX records pointing to Google apps and a routing rule sends all messages received by our Google apps account to the office 365 mail server.

When I add a Google apps routing rule to take messages to users in a specific group (those that want to use Google apps mail), and route them normally (to Google apps mail) External domain user's messages are received correctly, however mail messages originating from office 365 are not routed through the MX record (to Google apps mail). Office 365 docs specify that this scenario requires that the domain be configured as an "Internal Relay Domain", and I've set this option in

Office 365 -> Exchange Admin -> Mail Flow -> Accepted Domains
-- (Edit Domain, check Internal Relay Domain)

However mails sent from inside office 365 addressed to users with accounts in 0ffice 365 continued to appear in office 365 mailboxes, and are not routed to the mx mail server (Google apps), and thus are not appearing in Google apps mail mail boxes.

It appears that Office 365 doesn't route the mails if the address exists in office 365's exchange address book. These users need to keep there office 365 accounts for Lync, Share Point, etc access.

I want Office 365 to route sending messages, either for everyone, or just specific users (the ones on Google Apps) through either the domain mx record (which is Gmail) or explicitly through the Gmail mail server.

If Disabling the Exchange app in Office 365 for these accounts is possible, I don't know how to do it, but removing these accounts from Office 365 altogether is not a viable solution.

share|improve this question
    
If the answers you were provided help you with your question, you should select one as an accepted answer. –  mfinni Apr 14 at 15:47

1 Answer 1

The problem here is how Exchange itself works (O365):

However mails sent from inside office 365 addressed to users with accounts in 0ffice365 continued to appear in office 365 mailboxes, and are not routed to the mx mail server (google apps), and thus are not appearing in google apps mail mail boxes.

This is to be expected. Exchange isn't going to send email to an external MX record for example.com if their email address is bob@example.com associated with a mailbox on the Exchange Online Org for your Office 365 domain. The routing of the email will dictate that the user is local and should be treated as such.

You have a couple of options as I see it:

Option #1:

Assuming you are using 2 distinct email domains for O365 and Google Apps you could have individual mailboxes on O365 forward any incoming email to the external Google Apps domain. I know you said your MX records go to google apps so you are probably only using a single domain name, but you could look at forwarding it to their gmail associated address instead and then setting their primary email address for new emails and replies to their real company domain email address.

In this instance the example would be:

Email to bob@domain.com > google apps mx > Office 365 route > Office 365 forwards email for bob to bob@gmail.com > google apps receives email and delivers to Bob > when Bob replies he chooses to reply as bob@domain.com instead of bob@gmail.com

Option #2

Like O365 support said, you can look into setting up the Internet Relay Domain option. What they were referring to is called Shared SMTP Namespace. I've never done it with Google Apps, but the concept is the same with them overall I would presume.

However, the issue you are running into is probably because you have actual mailboxes instead of contact email addresses only for those users. They can't have actual mailboxes on the Exchange/O365 server itself, just an O365 user ID with a contact email address.

But you'll also have to setup such a thing on Google Apps side somehow to (again not familiar with how they do it)...because otherwise you'll end up with a loop. You'll need something on their side that says "check for mailbox and if not found send to O365".

The flow would work like:

External Email to bob@domain.com > google apps receives and checks for local mailbox. If found, deliver...if not > Office 365 route > O365 delivers to mailbox there.

Office365 user emails bob@domain.com > Office 365 finds no Exchange mailbox but does see bob@domain.com as a contact > Exchange Online has the Internet Relay Domain setup for domain.com and the next hop set back to send outbound to the MX record > google apps receives email and delivers to Bob's mailbox locally on Google Apps.

Again, you'll need to make sure that Google Apps knows to check for bob@domain.com mailbox locally before sending everything else on to O365. Otherwise it will cause a mail routing loop.

Hope that helps.

share|improve this answer
    
All of our users have email boxes on Google apps and Office365. Google Apps happily routes mail for 1. specific user, 2. Members of specified groups, or 3. Mail to addresses matching a regular expression, to office 365, but mail boxes exist on office 365 as well, and the question is entirely about how to (have messages sent from within office 365 to a mailbox that DOES exist in office 365) routed to Google apps. The scenarios mentioned above are already achieved. –  gbegley Feb 17 at 11:46
2  
I explained how...This is to be expected. Exchange isn't going to send email to an external MX record for example.com if their email address is bob@example.com associated with a mailbox on the Exchange Online Org for your Office 365 domain. The routing of the email will dictate that the user is local and should be treated as such. -- if you keep their mailboxes on O365, it will treat them as local and not route them back to Google Apps unless you have fwd rules in their mailboxes to a gmail address or similar (option #1). So neither of the options I mentioned have been done by you yet. –  TheCleaner Feb 17 at 13:59
    
So your entry is, "This isn't possible"? Option 1 is not valid as it doesn't solve my problem. It's not about forwarding mail to any account, but to our domain accounts in Google apps, which have the same mail address as office 365. –  gbegley Feb 17 at 15:45
    
Everything works correctly on the Google apps side. The only issue is getting mail from user1@mydomain.com on Office 365 to user2@mydomain.com on Google Apps however both accounts need access to Office 365 Sharepoint and Lync. –  gbegley Feb 17 at 15:59
    
My entry is it is possible if you are willing to do either Option 1 or 2...but not if you want mailboxes on both systems. You'd have to only have an O365 account without a mailbox for a user that you want to use on Google Apps. You'd have to remove that user's O365 mailbox and Exchange Online license and just stick with the other portion's of the O365 license instead. Then you'd have to create a contact for that user with their actual email address. With it being a contact and not a mailbox it will forward on to the shared SMTP Namespace. –  TheCleaner Feb 17 at 16:14

protected by Community Aug 5 at 11:04

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.