NOTE: Article updated July/2021
It was intense 3 days of googling and trying to make my client’s email work since some users had been configured on google and others left on the Cpanel server for reason best known by the client.
Make sure you configure split delivery very well as Google advises here https://support.google.com/a/answer/2685650. If you have difficulty understanding google’s configs here is short version of it all.
- In your Google Admin console, go to Apps -> Google Workspace (core services) -> Gmail
ADD HOST (Add mail Route)
Under Gmail go to Hosts then Add a mail route for a domain ( Follow the google link here https://support.google.com/a/answer/2614757 ).
To add Host, click on ettings for Gmail (as shown by screenshot below)
Add Name for your route (anything can do say "LOCAL-MAILS")
Then add Single host ===> IP address and Port either 25 or 587 depending on your local server host.
NOTE: Do not enable "Require CA signed certificate" option if you do not have a valid SSL Certificate.
ADD ROUTING RULEThis rule is the one that detects what email to be redirected to the local mail server when received by Google.
Move to Settings for Gmail ===> Routing (scroll at bottom) and click to configure | Route outgoing emails to the following SMTP server
Under Routing, Add a NEW RULE.
Settings in your Routing should be as follows
- Routing Name = Name of your route “My Other Mails” you can give the route any name you will easily remember
- Email messages to affect = Choose "Inbound" and "Internal - Receiving"
- Route ==> click Change route : Add the mail route you had configured in Step 2.
- scroll down and click on Show options
- Accounts type to affect = choose Unrecognized / Catch-all
Under Default routing Tab
Under Settings for Gmail ===> click on Default Routing
Click on ADD SETTING
- Specify envelope receipts to match choose Pattern match
Scroll down to Envelope recipient, choose Change envelope recipient and click Replace domain and add in your yourdomainname.com
- Options ->perform this action on non-recognized and recognized addresses
Now that your done with Google Workspace side, its time to get into your Cpanel.
- Remember that you had already configured your MX records pointing to Google Workspace.
- Your DKIM and SPF must reflect both servers if you’re to avoid authentication email errors when trying to send to emails remaining in cpanel (non-gmail). See error below
Alternatively you can use Email Deliverability tool in Cpanel to help you configure your authentications right.
- Root domain (yourdomain.com) and subdomain (gapps.yourdomain.com) must have their MX records pointing to Google's MX servers;
Create Aliases Domain
There must be a subdomain CNAME (gapps. yourdomain.com) as alias of root domain (yourdomain.com), this will be used to deliver mail sent through cPanel or its SMTP.
- In Cpanel go to Domains -> Aliases
After creating your alias domain below same area click on manage redirection to point the alias to primary domain “yourdomain.com” .
- This must also be set as a domain alias on Google Workspace.
Please ensure you follow google steps https://support.google.com/a/answer/7502379
- This required setting up the alias and pointing it to yourdomain.com to be able to put the file that Google Apps wanted in place to verify the domain (gapps. yourdomain.com) belonged to us.
Instructions are given by Google when trying to add a domain alias. (https://support.google.com/a/answer/7502379?hl=en)
- Make your primary domain MX record to point to google apps mail servers and set as 'Local Mail Exchanger'
- Make alias domain “gapps.yourdomain.com” set as ‘Remote Mail Exchanger’
- Under Email Forwarders add a Domain forwarder from your primary domain “yourdomain.com” to “gapps.yourdomain.com”
Add a New Domain Forwarder
NOTE: Ensure you create two forwards. (1) yourdomain.com to gapps.yourdomain.com (2) gapps.yourdomain.com to yourdomain.com
If you configure those two stages very well, you will surely enjoy gsuite split delivery.