The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Google Apps split delivery for domain

Discussion in 'E-mail Discussions' started by Vliegtuig, May 13, 2011.

  1. Vliegtuig

    Vliegtuig Well-Known Member

    Joined:
    Jan 21, 2010
    Messages:
    74
    Likes Received:
    2
    Trophy Points:
    6
    We host our own company on our WHM server and are currently switchting to Google Apps.

    90% of the email addresses on this domain are to be migrated to Google Apps, but the remaining 10% are to be used by our ticketing system, for example, and don't need to be migrated.

    Google Apps facilitates this by offering split delivery. I have now setup this correctly, but the problem is that WHM will not accept mail as long as I have it configured as a Remote MX Exchanger.

    Changing to a Backup MX Exchanger will also not work.

    Local MX will work, but when sending mail to a Google Apps account from our WHM server, the email will never leave the server.

    How can I go about to solve this problem?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    How did Backup MX Exchanger not function in this regard? You would have to ensure to have the cPanel machine as one of the MX records (the secondary priority record), then ensure the domain is both in /etc/secondarymx and /etc/remotedomains files.

    The way it should then work would be that the domain will only accept messages to the cPanel machine if it cannot reach the primary MX record and hold those emails in the queue until the primary MX is available and deliver those messages at that point. This does not split the delivery precisely, it only serves as a backup mail exchanger.
     
  3. Vliegtuig

    Vliegtuig Well-Known Member

    Joined:
    Jan 21, 2010
    Messages:
    74
    Likes Received:
    2
    Trophy Points:
    6
    Hi Tristan,

    The problem is that we need *some* emails to deliver to our Cpanel server, and *some* to Google Apps. Google apps provides for this by forwarding the mail to the server. No additional MX-records are needed for this.

    The current problem seems to exist within my WHM mailserver configuration. We receive mail perfectly fine, but when clients of ours that use our WHM mailserver try to mail us, the mail will be delivered locally and not forwarded to the mail server.
     
  4. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    From what it sounds like, it probably won't work when sending it locally from the server. Your server should be setup to accept mail for your domain and your mx records point to google. Google forwards the email to your server which accepts it. You will probably need a custom router that forwards email to google if the email is not coming from their ip address. Another option would be to just create a forwarder and accept mail on your server for a subdomain like ticksts@tickets.domain.com.
     
  5. Vliegtuig

    Vliegtuig Well-Known Member

    Joined:
    Jan 21, 2010
    Messages:
    74
    Likes Received:
    2
    Trophy Points:
    6
    Hmm this is quite problematic.

    I currently have our domain configured as a local MX, with the MX actually pointing to Google Apps. Google Apps will forward the mail to my server if the account is not known. This all works just fine.

    I currently experience two problems:

    1. Mail sent through daemons to our @company.com domain will never leave the server
    2. Mail sent by client by clients that use our WHM mail gateway directed to @company.com will never leave the server

    Is there *any* way I can solve this problem?
     
  6. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi,

    Did you ever get this working?
     
  7. Vliegtuig

    Vliegtuig Well-Known Member

    Joined:
    Jan 21, 2010
    Messages:
    74
    Likes Received:
    2
    Trophy Points:
    6
    Hi SoftDux,

    I did, as a matter of fact, albeit through a hacky solution:

    * I have configured my domain (domain #1) as a 'Local Mail Exchanger'
    * I have setup MX-records for my domain to point to Google
    * I have added an email routing destination from my Google Apps dashboard, pointing to my server IP
    * I have configured email routing in Google Apps for 'unknown accounts only'
    * I have setup an additional domain (domain #2) on my server, acting as a remote MX. The MX-records point to Google as well. I have also configured this domain as a domain alias in Google apps.
    * I have created local e-mail accounts for the non Google users on domain #1.
    * I have created forwarders for Google Apps users on my domain #1, pointing to domain #2. (Otherwise, outbound email from my server to the domain #1 would be impossible)

    How this works now:

    * Non Google Apps email is sent to Google, marked as 'unknown', then forwarded to my server IP, which receives it locally.
    * Google Apps email just works
    * The forwarders are in place to make sure I can still send mail from my server to my primary domain.
     
    ropfer likes this.
  8. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    mmmm, sounds like a lot of trouble it something goes wrong inbetween. But, at least you got it working :)
     
  9. rafael_josem

    rafael_josem Registered

    Joined:
    Apr 20, 2012
    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Oh my God, it works! You're a Genius. Thank you very much!!

    My hosting company support told me it was impossible!
     
    ropfer likes this.
  10. David Brown

    David Brown Registered

    Joined:
    Aug 4, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Trion, GA
    cPanel Access Level:
    Reseller Owner
    Hello!

    I am going through the exact same issue and would like to get some guidance on the last step, which says, "I have created forwarders for Google Apps users on my domain #1, pointing to domain #2. (Otherwise, outbound email from my server to the domain #1 would be impossible)."

    In my case, domain #1 is domain.net and I created a subdomain for domain #2 called remotemx.domain.net. How should I create the forwarding addresses? Do I need to create new mailboxes on remotemx.domain.net first for each of the Google Apps users? So for example:

    david.brown@domain.net -> david.brown@remotemx.domain.net

    If I could get some additional clarity on this step, it will be greatly appreciated.

    Thanks!
    -David
     
  11. stephen clark

    stephen clark Registered

    Joined:
    Aug 30, 2015
    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Warwick, UK
    cPanel Access Level:
    Reseller Owner
    David

    I have split delivery working on a client's site but used a slightly different solution.

    It is based on https://support.google.com/a/answer/173534?vid=1-635762641728926781-3447645210

    Step#7 is the key.

    However I didn't know whether they meant set up a Domain Alias in google apps or through Cpanel in your main Domain - so I did both.

    In any case I couldn't get the legacy non-gmail accounts to work until I did the following:

    1. Do everything in the support.google.com link paying particular attention to step #7
    2. Change the Main Domain MX record to point to google apps mail servers and set as 'local mail exchanger'
    3. Change the domain alias MX record to point to your Main Domain's mail server and set as 'remote mail exchanger'.
    4. That's it - no setting of mail forwarding or anything else.

    I hope that helps

    Stephen
     
    ropfer likes this.
  12. ropfer

    ropfer Registered

    Joined:
    Oct 22, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Colorado
    cPanel Access Level:
    Website Owner
    Stephen Clark's method worked for me. For clarification you only need to create the Domain Alias on your host (cPanel). I now can route unregistered emails to cPanel and registered Google Apps emails to Google Apps. I now don't need to pay monthly for each non-registered Google Apps account!

    Thanks, especially when there's probably 5 other emails referencing split email delivery and claiming it's not possible with cPanel.
     
  13. Zaw Htoo Aung

    Zaw Htoo Aung Registered

    Joined:
    Oct 24, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Myanmar
    cPanel Access Level:
    Website Owner
    St
    Hi Stephen Clark,

    I followed your step, I still can't send and mail from non-google account. Can you help me to fix it?

    Thanks
     
  14. Osama Tariq

    Osama Tariq Well-Known Member

    Joined:
    Nov 27, 2014
    Messages:
    187
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Lahore, Pakistan
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Stephen Clark & SoftDux,

    I followed you both of your steps, but it cannot worked for me. Can you help me a lil bit !!
     
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  16. Lucas Mentz

    Lucas Mentz Member

    Joined:
    Jul 23, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    Hello. I am a shared hosting customer on HostGator. I tried to follow Stephen Clark's tutorial but I remain with the initial problem.

    As I did it:
    Google Apps has double delivery properly configured.
    CloudFlare is the NameServer for my domain.
    On CloudFlare: root domain MX records point to google mail, A and CNAME records point to HostGator for web hosting services.
    On CPanel: root domain MX records point to google mail using Local Server configuration; subdomain hstg.domain.com MX records point to HostGator and are on Remote Server configuration.

    It doesn't seem to work because mail sent from Google Apps are delivered correctly on both mail servers (Google and HostGator) but mail sent from HostGator never reach the users on Google Apps but reach the users on HostGator.

    Could I get some help on what I'm missing here?
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I suggest consulting with your web hosting provider so they can take a closer look and determine if any local server settings will require you to make additional steps for this custom configuration.

    Thank you.
     
  18. Lucas Mentz

    Lucas Mentz Member

    Joined:
    Jul 23, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    Thanks for the quick reply.

    With HostGator the answer was "It's not possible" no matter how kindly and explained I asked.
    That way I was seeking for alternatives that would work without having to ask them anything and I found this topic as the one with the exact scenario as mine and with the most successful replies.
     
  19. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You will likely find difficulty troubleshooting the issue on a shared hosting environment, due to the lack of root access to troubleshoot the issue.

    Thank you.
     
  20. Lucas Mentz

    Lucas Mentz Member

    Joined:
    Jul 23, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    I have managed to get the system working on split delivery.

    For anyone wanting to achieve split delivery with Google Apps and cPanel on a shared hosting rnviroment, these are the steps:

    1. root domain (domain.com) must have MX records pointing to Google's MX servers;
    2. there must be a subdomain CNAME (gapps.domain.com) as alias of root domain (domain.com), this will be used to deliver mail sent through cPanel or its SMTP;
    3. there must be another subdomain CNAME (cp.domain.com) as alias to the cPanel hosting server (in my case, HostGator's server br###.hostgator.com.br, masked for example purposes);
    4. Google Apps Split Delivery must be correctly configured (Configure split delivery - Google Apps Administrator Help), with the subdomain described in step #3 as the destination (step 7 on this page);
    5. on cPanel, use Local Server as the setting on the MX Records page for the root domain;
    6. on cPanel, set a Domain Forwarder with "from: domain.com" and "to: gapps.domain.com";
    7. on Google Apps, set a default route to change envelope recipient of all mail that corresponds to the REGEXP "\w+@gapps.domain.com" with the "Replace Recipient" setting, set to the "existing-user-name@domain.com" option.

    These are the steps I took to manage the desired outcome of split delivery without having users on the cPanel side that can't reach the users on the Google Apps side.

    If anyone have any questions feel free to ask for help.
     
Loading...

Share This Page