Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail thinks our email is NOT from the FROM domain and puts it in Spam Folder, how to solve this?

We have a website where we allow you to reset your password (say if you forget your password). This is standard on many websites. Basically you enter your email address which you've used to register on our website, then we send you an email containing an email reset link.

This is all standard stuff. However, the problem is: Gmail somehow thinks this email we send to the user is spam, and puts it in the Spam folder.

The specific message Gmail shows is:

Be careful with this message. Our systems couldn't verify that this message
was really sent by xyz.com.  You might want to avoid clicking links or replying
with personal information.

Let me explain how we send the email. We use the company sendgrid.com to deliver the emails. xyz.com is a domain we control. (xyz is a pseudo-name here.) The email's from address is: [email protected]

We have changed xyz.com's SPF record to include "sendgrid.com" (and "sendgrid.net" "sendgrid.me").

There's no website associated with xyz.com, however.

My question is: what else can we do to make Gmail believe the email is from the domain xyz.com? So it doesn't put the email in the spam folder?

Thank you.

like image 572
Zack Xu Avatar asked Nov 07 '13 17:11

Zack Xu


1 Answers

Did you end up publishing DKIM with Sendgrid? Also, I have a feeling your SPF record isn't quite right as generally there's one official entry per email provider. You mention adding several. I'd recommend looking at their docs for exactly what they recommend publishing in your SPF. Do this for any provider you use for any kind of email.

Since you mentioned Sendgrid as your ESP, here are Sendgrid's instructions. Once you've done the DNS you have to ask Sendgrid to "sign" it. Since DKIM uses cryptography you'll need them to do their side.

DKIM's less complicated than it sounds. The DNS records you have to add will take a few minutes then presumably open a ticket to Sendgrid to have them do their side.

Also, as an aside, could you post what you have for your SPF record here? I don't mean your domain but what the value is? It's not directly causing the problem but it's a key component of email authentication.

Once you've completed SPF and DKIM, it is critical you validate them both. Do a search for SPF validates and DKIM validator to find online tools.

like image 139
Neil Anuskiewicz Avatar answered Oct 02 '22 15:10

Neil Anuskiewicz