"Forbidden" error trying to send newsletter

Hello, Ghost community. I am hosting several Ghost installs on one machine. All are working very well, including sending newsletters. All but one, and I can’t figure out what the issue is, as I have set it up the same way as I have done the others. I have even deleted my DNS records and entry in Mailgun and tried again. Alas. still no go.

Whenever I try to send a newsletter, I get this entry in my error log:

{“name”:“Log”,“hostname”:“artemis”,“pid”:66920,“level”:50,“err”:{“domain”:“https://normanmailersociety.org”,“message”:“Forbidden”,“stack”:“”},“msg”:“Forbidden”,“time”:“2023-01-06T16:44:33.272Z”,“v”:0}

I tried “ghost doctor” and all is as it should be. Sending via SMTP works just fine. Mailgun help has been no help; they seem to think it’s a Ghost issue. Any assistance would be very appreciated.

Ghost-CLI version: 1.24.0
Ghost version: 5.26.3

Welcome to the Ghost community, @grlucas
As a first step, can you confirm that this works?

curl -s --user 'api:YOUR_API_KEY' \
    https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
    -F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \
    -F to=YOU@YOUR_DOMAIN_NAME \
    -F to=bar@example.com \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'

@mjw thanks!

Sorry, I should have mentioned: that command DOES work with no problem.

Double check that the Mailgun URL is correct for your region. For instance, I need to use api.eu.mailgun.net. Otherwise, I get this error from Mailgun.

Yes, I’m in the US, so that’s the one I’m using.

Also, nothing seems to even get through to Mailgun, as no indication of an error is in my mg logs.

And you’re hosting in the US, too, I guess?

My MacBook just died, so I currently have limited Internet etc.

However, given everything is on one server (I assume native installations?) and Node etc. is the same, I’d try, after taking a snapshot, reinstalling the Ghost instance using the same DB. Don’t forget to archive your images and take copies of your routes.yaml and redirects.

Yes, the server is in the US. And, yes, they are native installations. I considered reinstalling, but thought I there must be an easier solution.

Well, thanks for your help.

1 Like

I spent all morning installing a fresh version of Ghost only to get when I try to send a newsletter:

{"name":"Log","hostname":"artemis","pid":79681,"level":50,"err":{"domain":"https://normanmailersociety.org","message":"Forbidden","stack":""},"msg":"Forbidden","time":"2023-01-07T17:21:30.452Z","v":0}

I just can’t believe this. What am I missing?

A couple of thoughts…

  1. Are the Mailgun credentials unique for the domain, i.e., you’re not using those for another?
  2. The domain is new, and Mailgun has restrictions enabled. How many newsletters are you attempting to send? Have you tried just a few?

The error implies that Mailgun is rejecting, so it’s either misconfigured (in Ghost or Mailgun), or there are restrictions on this account.

How about testing this instance with their sandbox?

@mjw thanks for the suggestions.

  1. Yes, they are unique. That said, I do have to use the account API, which other domains share. Along similar lines, I did try to use another domain I set up for Mailgun on this Ghost install, and I received the same error. That led me to believe it was my server, but I’m not so sure now.
  2. Mailgun help insists that it is not their service that’s causing the error. I’m not sure if I believe them, though. I have a bout a dozen subscribers right now, about as many as another Ghost install on the same server that works fine. I’m not sure how’d I try sending just a few.

I did not know there was a sandbox. I will investigate.

1 Like