Failed to send magic link email+

I set up mailgun on https://ghost8943234.pikapod.net/

Yet I still can’t subscribe it says “Failed to send magic link email”

CleanShot 2024-01-08 at 11.36.18

Mailgun is only used for the bulk email sending – so, the newsletter.

For transactional emails you need to set up an email configuration in your config file.

This link also has an example to use Mailgun for that, but it is a different setup than the newsletter:

Thanks, I see code here. I’m not a coder. I set up ghost via pikapods. There is no way to add the SMTP details in the settings front end?

If now how do I do this, I have. no clue…

No, there is no way to do this through the settings. I am also unfamiliar with Pikapods, so you might want to reach out to their support.

Edit: just googled and found this: Ghost | PikaPods Docs
Looks like you can add environment variables somewhere.

Wow thanks for that. I followed the steps there and added the variables.

And I no longer got the error:

CleanShot 2024-01-08 at 12.18.27

Unfortunately, however, I haven’t received the email…
(I checked spam)

I would usually suggest to look at the Ghost logs, but I am not sure if Pikapods allows that, sorry.

You could also check Mailgun to see if the email is in the logs there.

Seems like I found the failed send in the mailgun logs:

{
	"recipient-domain": "gmail.com",
	"storage": {
		"region": "us-east4",
		"env": "production",
		"key": "BAABAAUTXz_4t_RbLMRC25uI0G1wsm6sZA",
		"url": "https://storage-us-east4.api.mailgun.net/v3/domains/mail.barnabynagy.com/messages/BAABAAUTXz_4t_RbLMRC25uI0G1wsm6sZA"
	},
	"user-variables": {},
	"id": "TlbDMzewSZSS4IOiSjx1nw",
	"tags": [],
	"flags": {
		"is-authenticated": true,
		"is-system-test": false,
		"is-routed": false,
		"is-test-mode": false
	},
	"message": {
		"attachments": [],
		"size": 17442,
		"headers": {
			"message-id": "2613d087-67cd-a35c-3c71-13dc3853009b@ghost8943234.pikapod.net",
			"subject": "🙌 Complete your sign up to Barnaby Nagy!",
			"from": "Barnaby Nagy <noreply@ghost8943234.pikapod.net>",
			"to": "barnaby.nagy@gmail.com"
		}
	},
	"timestamp": 1704737794.0126016,
	"log-level": "error",
	"reason": "espblock",
	"envelope": {
		"sender": "noreply@ghost8943234.pikapod.net",
		"sending-ip": "159.135.228.6",
		"targets": "barnaby.nagy@gmail.com",
		"transport": "smtp"
	},
	"campaigns": [],
	"event": "failed",
	"severity": "permanent",
	"delivery-status": {
		"certificate-verified": true,
		"description": "",
		"tls": true,
		"mx-host": "gmail-smtp-in.l.google.com",
		"enhanced-code": "5.7.26",
		"attempt-no": 1,
		"code": 550,
		"utf8": true,
		"message": "5.7.26 Unauthenticated email from pikapod.net is not accepted due to\n5.7.26 domain's DMARC policy. Please contact the administrator of\n5.7.26 pikapod.net domain if this was a legitimate mail. To learn about the\n5.7.26 DMARC initiative, go to\n5.7.26  https://support.google.com/mail/?p=DmarcRejection 186-20020a2500c3000000b00db54a387d3bsi305268yba.665 - gsmtp",
		"session-seconds": 0.811
	},
	"recipient": "barnaby.nagy@gmail.com"
}

I changed the support email to my email and now the log looks like this:

{
	"timestamp": 1704755750.612555,
	"campaigns": [],
	"event": "failed",
	"id": "wpgIUt0vTeW9de31dnAJJw",
	"user-variables": {},
	"message": {
		"size": 17424,
		"attachments": [],
		"headers": {
			"message-id": "fccc2d2e-2698-9803-50e4-a177dfe69ecb@barnabynagy.com",
			"subject": "🙌 Complete your sign up to Barnaby Nagy!",
			"to": "barnaby.nagy@gmail.com",
			"from": "Barnaby Nagy <barnaby@barnabynagy.com>"
		}
	},
	"severity": "permanent",
	"reason": "espblock",
	"envelope": {
		"targets": "barnaby.nagy@gmail.com",
		"sending-ip": "159.135.228.6",
		"transport": "smtp",
		"sender": "barnaby@barnabynagy.com"
	},
	"log-level": "error",
	"flags": {
		"is-routed": false,
		"is-system-test": false,
		"is-test-mode": false,
		"is-authenticated": true
	},
	"recipient-domain": "gmail.com",
	"tags": [],
	"delivery-status": {
		"description": "",
		"enhanced-code": "5.7.26",
		"attempt-no": 1,
		"mx-host": "gmail-smtp-in.l.google.com",
		"certificate-verified": true,
		"utf8": true,
		"tls": true,
		"session-seconds": 1.028,
		"message": "5.7.26 Unauthenticated email from barnabynagy.com is not accepted due to\n5.7.26 domain's DMARC policy. Please contact the administrator of\n5.7.26 barnabynagy.com domain if this was a legitimate mail. To learn about\n5.7.26 the DMARC initiative, go to\n5.7.26  https://support.google.com/mail/?p=DmarcRejection a10-20020a0cca8a000000b0067f7b1f8f34si985002qvk.242 - gsmtp",
		"code": 550
	},
	"recipient": "barnaby.nagy@gmail.com",
	"storage": {
		"env": "production",
		"region": "us-east4",
		"key": "BAABAAXh6RLcnXULjVhL2YMKe1ND1Ou-Zg",
		"url": "https://storage-us-east4.api.mailgun.net/v3/domains/mail.barnabynagy.com/messages/BAABAAXh6RLcnXULjVhL2YMKe1ND1Ou-Zg"
	}
}

So you need a DMARC entry for your domain. Fortunately, since it’s your domain, you should be able to swing that! :)

1 Like

What DMARC entry do I have to put where? Is it not supposed to be instructed by mailgun? I did all their domain verifications and it’s all done and checkmarked.

Actually, looks like your DMARC says to refuse mail that doesn’t pass your SPF and DKIM record. And your SPF record doesn’t list your server’s IP as an allowed sender. I’d start there.

Email’s a pain! You may want to set up transactional mail through Mailgun or using your Google credentials – it tends to be easier.

SPF & DMARC and more:

Google option:

1 Like

But I’m already using mailgun! And I added all the records they showed me to add.

Please help! See logs above