Search code examples
sendgridgoogle-workspacedkimdmarc

DKIM validation warning when sending e-mail from Sendgrid API


I've bought a domain and I'm hosting Cloudflare as my DNS host. I mainly use this domain for sending emails.

I use Google workspace for receiving and sending emails, but I also use the Sendgrid API to send one automatic email a day from a simple python program (using Sendgrid's python library) I keep running.

I have correctly authenticated my domain in Sendgrid and added the CNAME records to Cloudflare as Sendgrid advises. I have also configured Google correctly with my domain using their info. I've tested both configurations with their tools.

I'm now in the process of adding extra security to my emails. I've configured SPF, DMARC and DKIM using the simple instructions Google provides. Added all the records once again to my DNS provider (Cloudflare) and started to observe my daily DMARC reports.

I'm using URIports (https://app.uriports.com/) to make sense of these reports :P

Apparently, everything is ok with the mails I send from Google. But not ok with the emails sent via Sengrid. The DMARC analysis is the following:

We have received the following report from google.com about 1 message that was received in the following timespan: 02-13 0:00 (24h). This email was received from IP address xxx.xxx.xxx.xxx with hostname something.outbound-mail.sendgrid.net supposedly from <user>@<mydomain>.

DKIM validation passed because at least one signature is valid

Signature 1 for domain <mydomain> passed. The message was signed, and the signature passed verification tests.
Signature 2 for domain sendgrid.info passed. The message was signed, and the signature passed verification tests but the DKIM signature domain sendgrid.info does not align with the Header-From domain <mydomain>.

SPF and DMARC validations are ok.

I confess I'm lost and I'm searching everywhere without success. Can anyone help me understading in what direction to go?

Can it be a problem with the python program?

Many thanks! Cheers!

Gil


Solution

  • To set your mind at ease, your setup is fine! Nothing to worry about.

    DKIM is, among other things a reputation tool. SendGrid is adding two signatures to your emails, one for your domain, which will help pass DMARC authentication. And one for their domain / service. This second one is optional from the DMARC perspective, but may improve Inbox delivery.

    There are many services that operate in a similar fashion, adding an additional DKIM signature to outbound emails.