SOLVED

Setup O365 in order that sends mail on another mail provider

%3CLINGO-SUB%20id%3D%22lingo-sub-1394972%22%20slang%3D%22en-US%22%3ESetup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1394972%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20administer%20a%20tenant%20for%20my%20organization%20that%20have%20users%20with%20various%20type%20of%20licenses.%20Some%20E5%20accounts%2C%20some%20business%20basic%20(that%20both%20have%20an%20exchange%20mailbox)%20and%20some%20o365business%20without%20mailbox.%3CBR%20%2F%3EFor%20a%20series%20of%20reasons%2C%20our%20corporate%20mail%20is%20still%20on%20Gsuite%2C%20so%20all%20the%20users%20(also%20the%20E5)%20have%20the%20%22real%22%20mail%20on%20google%20and%20we%20don't%20use%20(eve%20if%20you%20pay)%20the%20exchange%20mailboxes.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20many%20application%20(like%20Sharepoint%20or%20Teams)%20when%20a%20user%20is%20notified%20of%20something%20(eg.%20%40%20mention%20in%20a%20teams%20comment%20or%20%22notify%20the%20the%20team%22%20when%20I%20add%20a%20new%20document%20on%20a%20sharepoint%20library)%20the%20engine%20sends%20the%20mail%20to%20outlook.com%20for%20the%20exchange%20users%20or%20fails%20to%20deliver%20in%20other%20cases.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20there%20a%20possibility%20to%20setup%20that%20we%20have%20an%20external%20provider%20(I%20don't%20know%20if%20thru%20dns%20or%20something%20else)%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3Ethanks%20in%20advance%3C%2FP%3E%3CP%3ESandro%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1394972%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1395025%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1395025%22%20slang%3D%22en-US%22%3ESandro%2C%3CBR%20%2F%3EThe%20O365%20services%20like%20SharePoint%20and%20Teams%20were%20designed%20with%20the%20expectation%20that%20the%20primary%20user's%20mailbox%20is%20located%20in%20Exchange%20Online.%3CBR%20%2F%3E%3CBR%20%2F%3EA%20work-around%20is%20to%20configure%20Criteria-Based%20Routing%20(CBR)%20so%20that%20the%20email%20is%20forwarded%20to%20Google%20instead%20of%20the%20mailbox%20on%20Office%20365.%3CBR%20%2F%3E%3CBR%20%2F%3EInstructions%3A%3CBR%20%2F%3ECreate%20a%20new%20distribution%20group%20%22ForwardToGoogle%22%3CBR%20%2F%3EAdd%20the%20users%20to%20the%20group.%3CBR%20%2F%3EConnect%20to%20Exchange%20Online%20PowerShell%3CBR%20%2F%3E%3CBR%20%2F%3ECreate%20a%20CBR%20Connector%3A%3CBR%20%2F%3E%24result%20%3D%20New-OutboundConnector%20-Name%20%22CBRConnector%22%20-ConnectorType%20OnPremises%20-SmartHosts%20%E2%80%9Caspmx.l.google.com%E2%80%9D%20-UseMXRecord%20%24false%20-IsTransportRuleScoped%20%24true%3CBR%20%2F%3ECreate%20the%20Transport%20rule%20that%20redirects%20the%20mail%20to%20the%20connector%3CBR%20%2F%3E%24result%20%3D%20New-TransportRule%20-Name%20%22ForwardToGoogle%22%20-SentToMemberOf%20%22ForwardToGoogle%22%20-RouteMessageOutboundConnector%20%22CBRConnector%22%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20this%20was%20helpful%2C%20please%20mark%20as%20best%20answer.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1395131%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1395131%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5941%22%20target%3D%22_blank%22%3E%40Joe%20Stocker%3C%2FA%3E%26nbsp%3B%20first%20of%20all%20thanks%20for%20the%20response%20and%20for%20your%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20it%20seems%20it%20works.%20Sharepoint's%20notify%20is%20sent%20(in%20spam%20folder%2C%20but%20it%20is%20another%20story)%20and%20when%20I%20schedule%20a%20meeting%20in%20Teams%20mail%20are%20sent%20to%20Google.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20drawback%20is%20that%20now%2C%20if%20I%20schedule%20a%20meeting%20from%20Teams%20calendar%2C%20the%20creation%20is%20stucked%20(the%20spinning%20icon%20runs%20for%20minutes)%3B%20the%20meeting%20is%20created%2C%20because%20mail%20starts%2C%20the%20link%20works%20and%20the%20record%20in%20the%20Posts%20timeline%20exists%3B%20but%20after%20long%20waiting%2C%20on%20the%20calendar%20there%20is%20nothing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20I%20guess%20it%20is%20related%20to%20this%20change%2C%20because%20till%20yesterday%20I%20created%20dozens%20of%20meeting%20and%20they%20are%20all%20on%20the%20calendar.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestion%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1395940%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1395940%22%20slang%3D%22en-US%22%3EI%20assume%20the%20calendar%20doesn't%20contain%20the%20appointment%20because%20it%20was%20forwarded%20to%20google%2C%20so%20I%20think%20you'll%20have%20to%20train%20the%20user%20to%20not%20look%20at%20the%20Teams%20calendar%20but%20instead%20look%20at%20the%20Google%20calendar.%3CBR%20%2F%3EIf%20that%20is%20not%20acceptable%2C%20then%20you%20should%20disable%20the%20transport%20rule%20and%20then%20enable%20SMTP%20forwarding%20on%20each%20mailbox%2C%20as%20that%20will%20allow%20the%20appointment%20to%20show%20on%20both%20the%20Teams%20app%20and%20also%20the%20Google%20calendar.%3CBR%20%2F%3ETest%20it%20on%20a%20single%20mailbox%20first%3A%3CBR%20%2F%3ESet-Mailbox%20-Identity%20%22John%20Doe%22%20-DeliverToMailboxAndForward%20%24true%20-ForwardingSMTPAddress%20%22JohnDoe%40googleemail.com%22%3CBR%20%2F%3EThen%20to%20do%20it%20on%20all%20the%20rest%20of%20the%20mailboxes%2C%20put%20the%20source%20and%20destination%20address%20in%20a%20text%20file%2C%20then%20you%20could%20automate%20this%20like%3A%3CBR%20%2F%3E%23The%20'forwarding.csv'%20file%20contains%20two%20column%20headers%2C%20source%20and%20destination%3CBR%20%2F%3E%24import%20%3Dimport-csv%20forwarding.csv%3CBR%20%2F%3E%24import%20%7C%20%25%7BSet-Mailbox%20-Identity%20%24_.source%20-DeliverToMailboxAndForward%20%24true%20-ForwardingSMTPAddress%20%24_.destination%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20prevent%20the%20email%20from%20being%20sent%20to%20Google's%20spam%20folder%2C%20update%20the%20DNS%20SPF%20TXT%20record%20to%20include%20this%3A%3CBR%20%2F%3Einclude%3Aspf.protection.outlook.com%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1401557%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1401557%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5941%22%20target%3D%22_blank%22%3E%40Joe%20Stocker%3C%2FA%3E%26nbsp%3Bthanks%20again%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20strange%20thing%20is%20that%20if%20I%20schedule%20a%20meeting%20without%20indicating%20a%20specific%20channel%2C%20the%20event%20is%20created%20normally%2C%20mail%20is%20sent%20and%20it%20appears%20on%20calendar.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnly%20if%20I%20choose%20a%20Team%2BChannel%2C%20then%20I%20have%20the%20issue%20of%20long-spinning%20%2B%20diseappering...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQuestion%3A%20if%20I%20follow%20your%202nd%20hint%20I%20had%20to%20write%20so%3A%3C%2FP%3E%3CP%3E%3CSPAN%3ESet-Mailbox%20-Identity%20%22John%20Doe%22%20-DeliverToMailboxAndForward%20%24true%20-ForwardingSMTPAddress%20%22JohnDoe%40%3CSTRONG%3EmyDomain.com%3C%2FSTRONG%3E%22%3CBR%20%2F%3E%3CBR%20%2F%3Ewhere%20myDomain.com%20is%20the%20same%20for%20o365%20(exhange%20online)%20and%20Gsuite.%3CBR%20%2F%3ESo%20are%20you%20sure%20he%20will%20check%20the%20DNS%20MX%20and%20route%20to%20google%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThank%20you%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1403279%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20O365%20in%20order%20that%20sends%20mail%20on%20another%20mail%20provider%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1403279%22%20slang%3D%22en-US%22%3Eyes%2C%20MSFT%20will%20use%20DNS%20MX%20and%20route%20to%20google%20for%20the%20value%20inside%20ForwardingSMTPAddress%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi, 

I administer a tenant for my organization that have users with various type of licenses. Some E5 accounts, some business basic (that both have an exchange mailbox) and some o365business without mailbox.
For a series of reasons, our corporate mail is still on Gsuite, so all the users (also the E5) have the "real" mail on google and we don't use (eve if you pay) the exchange mailboxes.

In many application (like Sharepoint or Teams) when a user is notified of something (eg. @ mention in a teams comment or "notify the the team" when I add a new document on a sharepoint library) the engine sends the mail to outlook.com for the exchange users or fails to deliver in other cases.

 

Is it there a possibility to setup that we have an external provider (I don't know if thru dns or something else) ?

thanks in advance

Sandro

5 Replies
Highlighted
Best Response confirmed by SandroRiz (Occasional Contributor)
Solution
Sandro,
The O365 services like SharePoint and Teams were designed with the expectation that the primary user's mailbox is located in Exchange Online.

A work-around is to configure Criteria-Based Routing (CBR) so that the email is forwarded to Google instead of the mailbox on Office 365.

Instructions:
Create a new distribution group "ForwardToGoogle"
Add the users to the group.
Connect to Exchange Online PowerShell

Create a CBR Connector:
$result = New-OutboundConnector -Name "CBRConnector" -ConnectorType OnPremises -SmartHosts “aspmx.l.google.com” -UseMXRecord $false -IsTransportRuleScoped $true
Create the Transport rule that redirects the mail to the connector
$result = New-TransportRule -Name "ForwardToGoogle" -SentToMemberOf "ForwardToGoogle" -RouteMessageOutboundConnector "CBRConnector"

If this was helpful, please mark as best answer.
Highlighted

@Joe Stocker  first of all thanks for the response and for your time.

 

Yes, it seems it works. Sharepoint's notify is sent (in spam folder, but it is another story) and when I schedule a meeting in Teams mail are sent to Google.

 

The only drawback is that now, if I schedule a meeting from Teams calendar, the creation is stucked (the spinning icon runs for minutes); the meeting is created, because mail starts, the link works and the record in the Posts timeline exists; but after long waiting, on the calendar there is nothing.

 

And I guess it is related to this change, because till yesterday I created dozens of meeting and they are all on the calendar. 

 

Any suggestion?

Highlighted
I assume the calendar doesn't contain the appointment because it was forwarded to google, so I think you'll have to train the user to not look at the Teams calendar but instead look at the Google calendar.
If that is not acceptable, then you should disable the transport rule and then enable SMTP forwarding on each mailbox, as that will allow the appointment to show on both the Teams app and also the Google calendar.
Test it on a single mailbox first:
Set-Mailbox -Identity "John Doe" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "JohnDoe@googleemail.com"
Then to do it on all the rest of the mailboxes, put the source and destination address in a text file, then you could automate this like:
#The 'forwarding.csv' file contains two column headers, source and destination
$import =import-csv forwarding.csv
$import | %{Set-Mailbox -Identity $_.source -DeliverToMailboxAndForward $true -ForwardingSMTPAddress $_.destination

To prevent the email from being sent to Google's spam folder, update the DNS SPF TXT record to include this:
include:spf.protection.outlook.com
Highlighted

@Joe Stocker thanks again

 

The strange thing is that if I schedule a meeting without indicating a specific channel, the event is created normally, mail is sent and it appears on calendar.

 

Only if I choose a Team+Channel, then I have the issue of long-spinning + diseappering...

 

Question: if I follow your 2nd hint I had to write so:

Set-Mailbox -Identity "John Doe" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "JohnDoe@myDomain.com"

where myDomain.com is the same for o365 (exhange online) and Gsuite.
So are you sure he will check the DNS MX and route to google?

 

Thank you

Highlighted
yes, MSFT will use DNS MX and route to google for the value inside ForwardingSMTPAddress