How to integrate SendGrid with Cloudflare?


#1

I’ve followed the instructions that SendGrid has provided however, my transactional emails from woocommerce are still not being delivered.

Is there anyway to make sure I’ve implemented SendGrid correctly on Cloudflare?

Thank you!


#2

Can you please provide a link to said instructions, so we could see where might be the culprit? If you don’t mind sharing your domain name, it will also help to query your domain and see what you did.

In general, the only integration I can think of, is for verification purposes and/or message signing. Or in other words, setting up of TXT/CNAME records in your domain’s DNS. There’s not much to get wrong there with regards to Cloudflare’s part, with the sole exception of setting up of CNAME records that are used in validation: in Cloudflare, if you set up a CNAME and you do NOT disable the “go through Cloudflare” feature by clicking the orange cloud so it becomes grey, then what gets added to the DNS is not the CNAME you have requested, but instead an A record pointing to Cloudflare’s servers (who, in their backend, resolve your CNAME and proxy to it).

So side of copy/pasting correctly TXT/CNAME records and making sure that no orange cloud appear next to the CNAME, I don’t think anything could be special in Cloudflare for your matter. Maybe I’ll think differently if I see the instructions you were following.

P.S. Are your e-mails really “not delivered”, or are delivered and just find themselves at Junk Mail / Spam folders? What does SendGrid’s log show? That they received the e-mail, try to distribute it, and… what happens?


#3

thank you for your quick response!

i followed the following 3 sets of instructions:

  1. https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/
  2. https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/#what-is-link-branding
  3. https://sendgrid.com/docs/ui/sending-email/content-delivery-networks/#using-cloudFflare

all new entries are greyed out.

i’ve been creating a new wordpress/woocommerce account for testing using my own gmail and aol account. after i create a user, the user is supposed to receive link to set their password. these emails are showing up on SendGrid as “Processing”. I clicked on each test email to see the details and see that the message is deferred multiple times with the message “Email was deferred due to the following reason(s): [IPs were throttled by recipient server]”

I have woocommerce set up to notify me via email about a new account as well, those work fine. I’m thinking only because it’s to the same domain, however. The domain is melinaandme.com

thanks again!


#4

Thank you for the additional information. I have looked at your domain, and your TXT records. You seem to have an SPF record, but I don’t see sendgrid’s SPF record (include:sendgrid.net) there. Also I don’t know what CNAME they suggested to point to sendgrid.net so can’t test for it, and finally what subdomain you’ve used for DomainKeys.

But SPF is really the base - and publishing an SPF record that does not have the IP range you originate your e-mails from [as seen from the receiving party’s side] is probably a worse signal than having no SPF at all…


#5

do you see sendgrid’s SPF record now? Sendgrid’s documentation says “Most of our senders have set up a CNAME that points their sending domain to sendgrid.net. This means the receiving server sees the CNAME pointing to sendgrid.net, and checks that SPF record instead. So do not be surprised if most of the SPF records you query are identical.” However, i added what you suggested anyway. it’s in a txt record.


#6

#7

Yes, I can see it now. And yes you’re correct that you could set a CNAME to point to them, and then they send the e-mail as from with their CNAME, and then they publish the TXT record for their name.

I may have missed it, but I think you didn’t mention that you added a CNAME pointing to them and that you’ve set sendgrid to use that. If you did, then I was looking at the wrong place and would need the subdomain.yourdomain to query, see that it goes to sendgrid, then query sendgrid to validate the SPF.

While I do see an SPF, the generic one is like I wrote - include:sendgrid.net - you had that, and then you changed it to something that looks like the CNAME target. This will probably also work, but is redundant, because u9363764.wl015.sendgrid.net that you’re including, itself publishes a include:sendgrid.net - so you’re basically causing an extra lookup with no gain.


#8

i’ve only added the records that the instructions required in the 3 links above.

mail.melinaandme.com - is that what you need?

SPF was changed back to what you recommended.


#9

mail.melindaandme.com points to 148.72.24.64 which is a2plvcpnl112043.prod.iad2.secureserver.net which is GoDaddy.

You are saying you followed the directions of SendGrid and have set up an e-mail subdomain for them. mail.melindaandme.com is not the one because it is both not a CNAME, nor does it point to an IP owned by SendGrid.

So, IF you’ve set it up, it would be another CNAME. Maybe the CNAME is to u9363764.wl015.sendgrid.net which you’ve mentioned before. And if you haven’t and have set up SendGrid to use that CNAME, then when the recipient mail server will query it, it will get a non existent record…

If you have NOT set it up, then just include:sendgrid.net on your main domain, and having SendGrid send as [email protected] might be OK. It has been years since I last touched SendGrid. When I did it, I went and created the CNAME they requested, and it worked flawlessly.


#10

my mistake, yes the CNAME is to u9363764.wl015.sendgrid.net

all the CNAME records show as verified on the SendGrid dashboard - the one above, plus two domain keys


#11

If so, then it sounds you should be fine from both Cloudflare and SendGrid side, I think.

If it still doesn’t work, I think your best venue is actually SendGrid’s support.

There’s an option that the issue is elsewhere - if you’re on the cheap SendGrid plan, your IP is shared with many other users of SendGrid. That sometimes causes your IP to get blacklisted (from experience) even if you did not send any spam. Where I had this set up, we had to bump our subscription level to get our own IP, and then all temporary blocks went away. But it wasn’t cheap I recall… like x3 premium or so.

Anyway, I would try to fire a new e-mail at this point, and if it’s still stuck with the remote server “throttling” your IP, have SendGrid’s support take a look.

Hope this helps…


closed #12

This topic was automatically closed after 31 days. New replies are no longer allowed.