2

I send emails from my site via php smtp method connected to 'smtp.gmail.com' on 465, and account added to GSuite. All my emails falls in spam folder in Gmail. The kind of emails is just password recovery or email confirmation, but gmail shows orange mark with warning

"Be careful with this message. Gmail could not verify that it actually came from mydomain.com"

I configured SPF and DKIM record. But the issue is I use cloudflare.com and don`t put any real IP address in DNS records, so SPF record looks like that

v=spf1 include:_spf.google.com ~all

And A-type records set up with proxy IPs. While MX and DKIM records are well-configured due to GSuite manuals:

  • MX mydomain.com alt4.aspmx.l.google.com 10 Auto DNS only

  • MX mydomain.com alt3.aspmx.l.google.com 10 Auto DNS only

  • MX mydomain.com alt2.aspmx.l.google.com 5 Auto DNS only

  • MX mydomain.com alt1.aspmx.l.google.com 5 Auto DNS only

  • MX mydomain.com aspmx.l.google.com 1 Auto DNS only

  • TXT mydomain.com google-site-verification=my_code Auto DNS only

  • TXT mydomain.com v=spf1 include:_spf.google.com ~all Auto DNS only

  • TXT _dmarc v=DMARC1; p=quarantine; rua=mailto:my_mail Auto DNS only

  • TXT google._domainkey v=DKIM1; k=rsa; p=some_string Auto DNS only

So I suppose, the issue is with lack of real IP in records. Another thing is that my server domain and domain from which I send mails is different.

How can I configure my domain to make gmail trust it?

UPD: Is it safe to use reverse Reverse DNS and PTR record in this case? Will my real IP be accessable to any kinds of botnet or smth?

  • Why are you including the google spf records when you are not sending mails via google mail servers? – Gerald Schneider Jan 21 '20 at 13:53
  • I use connection to smtp.gmail.com' on 465 port, so I think it is sending from google servers – Valik Tralik Jan 21 '20 at 13:59
  • Have you fully verified your domain in GSuite and are you authenticating your connection to `smtp.google.com` successfully? If you enabled 2-step authentication, you might need to configure an app password. You may also want to switch to using port 587, which is default for client submission. It does require TLS instead of SSL. – Reinto Jan 22 '20 at 10:16
  • Yes, my domain is certainly verified, as I see it in GSuite console. Auth to smtp is successfully, if I understand how It works. My mails fall to users box, so I decided there is no problem with auth. But the problem is it falls to junkbox. I tried to change port and smtp secure type but the issue with junkfolder repeated. – Valik Tralik Jan 30 '20 at 12:36

0 Answers0