Skip to main content

Using cPanel and Office 365 in a hybrid scenario

Comments

20 comments

  • cPanelMichael
    Hello, Thank you for taking the time to share an example of how this could be acheived. I've moved this thread to our "Workarounds and Optimizations" forum. Thanks!
    0
  • Doc_br
    Hello, Thanks for sharing this. I just finished implementing this solution on my server, but I couldn't send emails from my on-premises accounts to the office 365 accounts. Since we are forcing the "Local Mail Exchanger" option, any email sent to accounts on the same server would not be sent to Office 365. To overcome this, I setup an email forwarding to the corresponding @mydomain.onmicrosoft.com email address. So for the email foo@mydomain.com that is now using Office 365, I created an Email Account Forwarder to the account foo@mydomain.onmicrosoft.com Now it is working!
    0
  • lulzimv
    Hello, I landed on this thread while searching on Google for the same question as the original poster. As this thread is quite old, I cannot answer there, so I open a new one hoping this helps both the original poster and any other guy with the same question. Also, if anyone has a better suggestion, I would be glad to read it. While Jcats's answer is correct when speaking about email routing via DNS, it does not contain the full truth about email routing. That is because DNS is not the only way to route messages between email servers of the same organization. That said, let me describe a little better the options. When setting up Office 365 on a hybrid scenario between a, let's call it, on-premise server (that is your WHM/CPanel server) and Office 365 Exchange Online you have to take a decision about the primary mail server. You can either choose all mails to be routed to Exchange Online or to your on-premise server. This is done using the MX record, as Jcats mentioned. Let's take the scenario that you choose to route all emails to Exchange Online. First you need to create a Connector in the Exchange Online ECP. Tell the connector to be used only when a transport rule is set up (we will create that later). Specify the on-premise IP address of your email server and the desired TLS configuration, if any. Then go to Recipients -> Contacts and create new contacts for every single email address you want to use, eg info@mydomain.com[/EMAIL], sales@mydomain.com[/EMAIL], etc. Last, go to Mail flow -> Rules and create a new rule for every contact you created. The rule should tell that if the recipient is info@mydomain.com[/EMAIL] then use the Connector you created. That is all needed inside Office 365 Exchange Control Panel. Now, you need to setup also WHM/CPanel. So, go to your client's CPanel. First, you have to edit the TXT SPF record so that both Exchange Online and CPanel's IP address are included. Then, go to MX Entry and choose Local Mail Exchanger. If you don't do that CPanel sees that the MX record shows to an external mail exchanger (that is Office 365's Exchange Online) and will forward the message back to Exchange Online, creating a loop that will end with an error "Hop count exceeded". Keep in mind that in our scenario you must leave Office 365 as the value of your primary MX record (that is .mail.protection.outlook.com). After that you will be able to use both Office 365 and WHM/CPanel in a hybrid scenario. The downside is that you have to check the consequences of the "Local Mail Exchanger" setting in CPanel. For example, maybe your site's contact forms will have problem sending you email to 365. It is something you have to check.

    Hi there why this explanation does not work for me ?
    0
  • cPanelMichael
    Hi there why this explanation does not work for me ?

    Hello, This is an unsupported workaround, but feel free to provide more details about the steps you took and what in-particular isn't working so that someone using the same workaround can better assist you. Thank you.
    0
  • Jacque
    Hi Guys, thanks for the info. I'm trying to set this up and configuring the outbound connector in EOP. Question is where do I find the CPanel mail server IP address? A Google search shows the various CPanel mail server IP addresses. Do I need to add all of them? Thanks
    0
  • Jacque
    Found the server IP under "Server Information". Tested and working. My setup is as follows: User migrated from CPanel to O365 but didn't have licenses for all mailboxes. They still needed some of the CPanel mailboxes to be active. MX record points to O365 Steps: 1. Login to CPanel and set Email Routing to "Local Mail Exchanger". Also confirm CPanel server IP address - Find it under "Server Information" 2. Create a contact in EAC for the mailbox located on CPanel. 3. In EAC create a connector - From O365 to Partner Organisation, Choose ti use connector only with transport rule, route to CPanel server IP as the smarthost. 4. In EAC create a transport rule - "Recipient is" the contact you created, "Do the following - use the connector", the one you created *In EAC when creating the new transport rule remember to select "more options" to view all menu items.
    0
  • cPanelMichael
    Hello @Jacque, I'm glad to see you were able to get it working. Thank you for sharing the instructions.
    0
  • Mohamed Firdous
    Found the server IP under "Server Information". Tested and working. My setup is as follows: User migrated from CPanel to O365 but didn't have licenses for all mailboxes. They still needed some of the CPanel mailboxes to be active. MX record points to O365 Steps: 1. Login to CPanel and set Email Routing to "Local Mail Exchanger". Also confirm CPanel server IP address - Find it under "Server Information" 2. Create a contact in EAC for the mailbox located on CPanel. 3. In EAC create a connector - From O365 to Partner Organisation, Choose ti use connector only with transport rule, route to CPanel server IP as the smarthost. 4. In EAC create a transport rule - "Recipient is" the contact you created, "Do the following - use the connector", the one you created *In EAC when creating the new transport rule remember to select "more options" to view all menu items.

    Hi Do i need to create a account in office365 for each email address that will forward ?
    0
  • cPanelMichael
    Do i need to create a account in office365 for each email address that will forward ?

    I'll leave this thread open for feedback from the original poster, but here's a quote from the initial post that explains this part in more detail:
    First you need to create a Connector in the Exchange Online ECP. Tell the connector to be used only when a transport rule is set up (we will create that later). Specify the on-premise IP address of your email server and the desired TLS configuration, if any. Then go to Recipients -> Contacts and create new contacts for every single email address you want to use, eg info@mydomain.com[/EMAIL], sales@mydomain.com[/EMAIL], etc. Last, go to Mail flow -> Rules and create a new rule for every contact you created. The rule should tell that if the recipient is info@mydomain.com[/EMAIL] then use the Connector you created.

    Thank you.
    0
  • oah
    HI i am trying to replicate what the original OP did, what is meant by the EAC ? @cPanelMichael
    0
  • vaysala
    Found the server IP under "Server Information". Tested and working. My setup is as follows: User migrated from CPanel to O365 but didn't have licenses for all mailboxes. They still needed some of the CPanel mailboxes to be active. MX record points to O365 Steps: 1. Login to CPanel and set Email Routing to "Local Mail Exchanger". Also confirm CPanel server IP address - Find it under "Server Information" 2. Create a contact in EAC for the mailbox located on CPanel. 3. In EAC create a connector - From O365 to Partner Organisation, Choose ti use connector only with transport rule, route to CPanel server IP as the smarthost. 4. In EAC create a transport rule - "Recipient is" the contact you created, "Do the following - use the connector", the one you created *In EAC when creating the new transport rule remember to select "more options" to view all menu items.

    what is EAC
    0
  • HeetWebM
    Hi Everyone, I was able to go through all the steps as mentioned but for some reason no matter what I try the validation for the connector fails. Every time I do receive emails on my smart host, even the message trace happily shows the mail as delivered, the connector however fails to validate. Could anyone suggest why this is happening and what shall be the workaround?
    0
  • 6thSense
    I see several people have asked but I can't see a respone. What is EAC? Exchange Almost Connected? Except All cPanel? Email Abandoned Centrally?
    0
  • cPRex Jurassic Moderator
    I believe this is Exchange Admin Center.
    0
  • kashi.aiden
    Hello, So I have a cPanel site through GoDaddy and our email is group Office365. The forms are not coming to our emails and we do not understand the above steps so much. Can we pay someone to help guide us through getting our forms working? The form inputs are coming through to cPanel, but they do not make it to Outlook. Thanks
    0
  • cPanelAnthony
    Hello! You can look for a qualified systems administrator to help here. SysAdmin Resources
    0
  • niceguy167
    So old topic, However what if we had it reversed we had a bunch of users who just use cpanel for email and a very few users who use o365 and we want to keep our main cpanel server as the primary mail server. Is there a way to accept O365 and allow O365 to replay through cpanel?
    0
  • cPRex Jurassic Moderator
    I don't believe that's an option either due to the way the MX records get handled.
    0
  • niceguy167
    What if we added outlook ips to allow relayed mail. Only issue there i would see is server could be vulnerable to spam attacks from other outlook users? I was able to make it work that way but I am guessing it's just a temp solution as i could see attackers using the relay if they set there outbound smtp host to ours in EAC.
    0
  • cPRex Jurassic Moderator
    If it's working for you that's great! You'll just want to keep an eye out for spam.
    0

Please sign in to leave a comment.