Google Workspace not receiving cPanel domain emails

hunt695

Active Member
Oct 30, 2019
38
7
8
croatia
cPanel Access Level
Root Administrator
Hi, I need some help on this one.
My Google Workspace email accounts can't receive emails from my clients (domain emails) on VPS that I own.
So basically there are 15 domains that can't send me an email, but they can receive mine.
My primary domain has a DNS zone on same server as all of my clients, only my MX records are pointing to Google.

After testing here's what I got:
  1. All of my domains that use Google MX records can't receive email from my clients domains on my VPS
  2. All of my domains using Google MX records can send emails to my clients and they receive them properly
  3. All client domains can send/receive emails with each other with no issues
  4. All client domains can send/receive to my free gmail account with no issues
  5. All of my domains that use Google MX records can send/receive email from my free gmail account with no issues
  6. cPanel > Track delivery says "Accepted" for any sent email (that I didn't receive)
This issue started recently and after a lot of troubleshooting with Google support I did the following in admin.google.com:
  1. Added every client domain to whitelist (Apps > Google Workspace > Settings for Gmail > Spam, phishing, and malware > Spam)
  2. Added all IP addresses that my clients use to allowlist (Apps > Google Workspace > Settings for Gmail > Spam, phishing, and malware > Email allowlist)
  3. Enabled and configured Inbound gateway by adding my IP's (Apps > Google Workspace > Settings for Gmail > Spam, phishing, and malware > Inbound gateway)
  4. Changed SPF records to include all client IP's for all of my domains
And, it's not f****** working, I don't know what else to do here, it's been a week now and I'm about to lose it.
Google says it's all about SPF, I still cant receive any email coming from my clients - imagine the irony.

Please, if anyone has a solution speak out for crying out loud.
Thanks
 
Last edited by a moderator:

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
779
320
363
cPanel Access Level
DataCenter Provider
Have you looked at the Exim log for email sent to your Google Workspace domain (on your VPS) to see what's happening? From there you'd be able to see if they are making it to Google and Google is accepting them.

Is your domain on the VPS? Is mail set to remove for that domain (if it's on the VPS)?
 
  • Like
Reactions: hunt695

rbairwell

Well-Known Member
May 28, 2022
98
42
18
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
The Track Delivery "Accepted" indicates to me that the server is delivering the email locally to the server - in which case, the following should help:

If you do have a cPanel hosting account for your primary domain (example.com) on the server:

Under "Email Routing" for the domain name (in cPanel, that's Email->Email Routing or WHM->DNS Functions->Email Routing Configuration), set it to "Remote Mail Exchanger".

If you do not have a hosting account for your primary domain (example.com) on the server:
* If the server's name is xxxx.example.com : confirm that there is NOT a DNS zone for example.com - if there is use WHM->DNS Functions->Delete a DNS Zone to remove it. Do not remove the xxxx.example.com zone.
* If the server's name is just example.com, you are going to have issues with lots of things.

I would then use a tool such as CheckTLS to ensure that Google's mail are being returned for your primary domain name. If they are, that'll isolate the issue to the server. Via SSH/Terminate try the following commands:
Code:
dig example.com MX +short
dig @localhost example.com MX +short
Again, they should return Google's mail servers (the first command will check which MX records are being returned from the nameservers the server should be using and the second will check the server itself).

You do not need to white list cliient domain/IP addresses and the Inbound gateway : but there should be no problems if they are set.

I have one cPanel server (called server1.example.com) hosting my corporate domain (example.com) - but with emails on Google Apps and I also have another cPanel server (server2.example.com) - both of which send my emails for example.com to Google Apps without difficulty.
 
  • Like
Reactions: hunt695

hunt695

Active Member
Oct 30, 2019
38
7
8
croatia
cPanel Access Level
Root Administrator
Thank you for detailed response @rbairwell, I really appreciate it.

The Track Delivery "Accepted" indicates to me that the server is delivering the email locally to the server - in which case, the following should help:
Yes, I've tested again and it says "Accepted."

If you do have a cPanel hosting account for your primary domain (example.com) on the server:
I do, it's on same server as my clients domains

Under "Email Routing" for the domain name (in cPanel, that's Email->Email Routing or WHM->DNS Functions->Email Routing Configuration), set it to "Remote Mail Exchanger".
It was set to "Local Mail Exchanger" and I've changed it to: "Remote Mail Exchanger"

I was carefully going trough your instructions and this step "Remote Mail Exchanger" solved it.
Man, you saved my ass and I feel silly now.

But the question now is, why did the exact setup work for years and began to fail now?
 
  • Like
Reactions: rbairwell

rbairwell

Well-Known Member
May 28, 2022
98
42
18
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
Glad it's fixed and it that was the "easy" option ;)

But the question now is, why did the exact setup work for years and began to fail now?
I've got no idea: if it was "Automatically Detect Configuration" I could understand, but if it was set to "Local Mail Exchanger" - this would imply a deliberate change.... The only possibilities I can think of (remembering I'm just a fellow customer and not staff so I don't have full knowledge of how the software works, but I can make "educated guesses") is perhaps a restore from backup/transfer from another server (I think I remember a setting there, but I can't see the option now) or a creation/deletion of the DNS zone.
 
  • Like
Reactions: hunt695

Kevin Andrews

Member
Mar 18, 2016
5
2
53
California
cPanel Access Level
Root Administrator
Choosing Remote Mail Exchanger creates other problems when using Google split delivery. It's a bit of a pain, but the workaround I found follows. When using Google split delivery, I've found over the years that it ALWAYS complicates email support issues with the hosting company, because their first response will always be "Your email is not hosted with us" and you have to try to explain to them how it works, at which point, they typically want to blow it off onto Google anyway.

Frankly, it would be great if Cpanel would add a choice for Google Split Delivery to the Mail Exchanger selection.

What I do is to create a forwarding email and/or email account on the Cpanel server for each email that is hosted on Google, forwarding the email to a Gmail account I created specially for this purpose. Then on that Gmail account, I create a forwarding filter for each address, to forward the email to the final Gmail hosted destination.

i.e., if my domain were xyz.com and the email [email protected] is hosted by Google using split delivery:

1. Create forwarding account and optionally an actual email account for [email protected]com on the Cpanel server, which forwards the email to [email protected]. The reason for creating an actual email account and not just a forwarding would be if you wanted to be able to send email from the cpanel server under that email for any reason.

2. Create a forwarding filter on the [email protected] account that forwards mail for [email protected] to [email protected]. Since the Google server will look to the MX records for delivery, the email will now be sent to the Google-hosted mailbox.