Google Apps split delivery for domain

Status
Not open for further replies.

Vliegtuig

Well-Known Member
Jan 21, 2010
74
2
58
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?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
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.
 

Vliegtuig

Well-Known Member
Jan 21, 2010
74
2
58
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.
 

sirdopes

Well-Known Member
PartnerNOC
Sep 25, 2007
141
0
66
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 [email protected].
 

Vliegtuig

Well-Known Member
Jan 21, 2010
74
2
58
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?
 

Vliegtuig

Well-Known Member
Jan 21, 2010
74
2
58
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.
 
  • Like
Reactions: ropfer

rafael_josem

Registered
Apr 20, 2012
1
1
53
cPanel Access Level
Website Owner
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.
Oh my God, it works! You're a Genius. Thank you very much!!

My hosting company support told me it was impossible!
 
  • Like
Reactions: ropfer

David Brown

Registered
Aug 4, 2015
2
0
1
Trion, GA
cPanel Access Level
Reseller Owner
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.
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:

[email protected] -> [email protected]

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

Thanks!
-David
 

stephen clark

Registered
Aug 30, 2015
1
1
3
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
 
  • Like
Reactions: ropfer

ropfer

Registered
Oct 22, 2015
2
0
1
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.
 

Zaw Htoo Aung

Registered
Oct 24, 2015
1
0
1
Myanmar
cPanel Access Level
Website Owner
St
David

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

It is based on Configure split delivery - Google Apps Administrator Help

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
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello :)

Could you provide more details on what in-particular is not working, or which steps you are having trouble with?

Thank you.
 

Lucas Mentz

Member
Jul 23, 2016
5
0
1
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
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.
 

Lucas Mentz

Member
Jul 23, 2016
5
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
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.
 

Lucas Mentz

Member
Jul 23, 2016
5
0
1
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 "\[email protected]" with the "Replace Recipient" setting, set to the "[email protected]" 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.
 
Status
Not open for further replies.