From address doesn't match a Sender Identy - SendGrid transactional mails

I wanted to set up transactional (not bulk, no need to say that in the comments) mails using SendGrid as I have in the past. So I created a new Sender Identity and verified it. Then tried sending an email through that using cURL, which worked flawlessly. Now I threw all that into the config.production.js:

{
  "url": "https://blog.mysite.com",
  "server": {
      "port": 2368,
      "host": "0.0.0.0"
    },
    "database": {
      "client": "mysql",
      "connection": {
          "host": "db",
          "user": "root",
          "password": "password",
          "database": "ghost",
          "charset": "utf8"
      }
    },
    "mail": {
      "from": "blog@noreply.mysite.com",
      "transport": "SMTP",
      "options": {
        "host": "smtp.sendgrid.net",
        "port": 587,
        "secureConnection": false,
        "auth": {
          "user": "apikey",
          "pass": "SG.thekey"
        }
      }
    },
  "logging": {
      "transports": [
            "file",
            "stdout"
          ]
    },
  "process": "systemd",
  "paths": {
      "contentPath": "/var/lib/ghost/content"
    }
}

Obviously with mysite.com and SG.thekey replaced with the actual values.

Now I’m confused, why would Ghost throw this error (or SendGrid in particular) when sending the magic link mail?

[2024-04-28 19:50:25] ERROR "POST /members/api/send-magic-link/" 500 767ms

Failed to send email. Reason: Message failed: 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

It works with cURL, but the same from mail doesn’t work with Ghost. So I’m thinking maybe Ghost sets the from address to something else or similar.

Any ideas?

Hi, were you able to resolve this? Facing the same issue.

You need to make sure that sendgrid is expecting the from address Ghost is using. If they’re mismatched, SendGrid throws this error, which Ghost is logging from you. It should be using the outgoing email set in the config file. Configuration - Adapt your publication to suit your needs