Bulk email using Mailgun can't escape [BULK_EMAIL_DB_RETRY] error

I’m at my wit’s end with the bulk email failing using mailgun. We only have 59 subscribers and mailgun shows none of my [many] attempts to send. It does log the “test” emails of how the post will look, and transactional emails when adding new contributors, as successful.

I’ve tried various config setups. I’ve tried the maligun API key locatable on maligun/accountsettings/API security. I’ve tried the “sending API key” from the left side menu sending/domainsettings/ –> “Add sending key” .

I tried using SMTP credentials and port 2025 instead of the API following the 2025 update to this post: Mailgun not working when on Digital Ocean (Ghost running with docker-compose). 504 in web ui, but 200 in docker logs - #9 by markstos

 "mail": {
    "from": "no-reply@newsletter.postcolonialpolitics.org",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "api.eu.mailgun.net",
      "port": 2525,
      "requireTLS": false,
      "secure": false,
      "auth": {
        "user": "newsletter@newsletter.postcolonialpolitics.org",
        "pass": "*******...."
      },
      "region": "eu"
    }
  },

The setup recommended here is much cleaner but also is not working for me. And actually the “mg” in the domain breaks the transactional new contributor emails. The bulk email fails either way.

 "mail": {
    "from": "no-reply@newsletter.postcolonialpolitics.org",
    "transport": "mailgun",
    "options": {
      "service": "Mailgun",
      "host": "api.eu.mailgun.net",
      "auth": {
        "api_key": "***************************",
        "domain": "mg.newsletter.postcolonialpolitics.org"
      }
    }
  },


{"name":"Log","hostname":"postcolonial-ubuntu-s-1vcpu-1gb-lon1-01","pid":58841,"level":50,"version":"6.0.9","err":{"id":"a2537ac0-93bc-11f0-9f84-31e70712cbc1","domain":"https://postcolonialpolitics.org","code":"BULK_EMAIL_SEND_FAILED","name":"EmailError","statusCode":500,"level":"normal","message":"Error sending email 68ca9e4153a6ade5d9ddde9a","stack":"EmailError: An unexpected error occurred, please retry sending your newsletter.\n    at BatchSendingService.emailJob (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:167:32)\n    at BatchSendingService.sendBatches (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:403:19)\n    at async BatchSendingService.sendEmail (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:213:9)\n    at async BatchSendingService.emailJob (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:158:13)\n    at async /var/www/postcolonialpolitics/versions/6.0.9/node_modules/@tryghost/job-manager/lib/JobManager.js:260:25\n    at async JobManager.worker (/var/www/postcolonialpolitics/versions/6.0.9/node_modules/@tryghost/job-manager/lib/JobManager.js:16:22)","hideStack":false},"msg":"Error sending email 68ca9e4153a6ade5d9ddde9a","time":"2025-09-17T11:51:23.502Z","v":0}
{"name":"Log","hostname":"postcolonial-ubuntu-s-1vcpu-1gb-lon1-01","pid":58841,"level":30,"version":"6.0.9","msg":"[BULK_EMAIL_DB_RETRY] email 68ca9e4153a6ade5d9ddde9a -> failed - Started (1st try)","time":"2025-09-17T11:51:23.502Z","v":0}
{"name":"Log","hostname":"postcolonial-ubuntu-s-1vcpu-1gb-lon1-01","pid":58841,"level":30,"version":"6.0.9","msg":"[BULK_EMAIL_DB_RETRY] email 68ca9e4153a6ade5d9ddde9a -> failed - Finished (after 1st try)","time":"2025-09-17T11:51:23.523Z","v":0}

I really have no idea what else to try and a lot of the forum posts are from a couple years ago at least.

My setup is:

Digital Ocean: 1 GB Memory / 25 GB Disk / LON1 - Ubuntu 22.04 (LTS) x64

Ghost-CLI version: 1.28.3

Ghost version:6.0.9

Node version 22.19.0

Everything checks out with ghost doctor, although it skips Validating config –> side note why??

I’m not using Docker and really would like to not bite that off just now, we’re a very small operation.

On Mailgun:

Sending records: 2 TXT, the dkim is active and the other is verified.

Receiving records: MX verified

Tracking records: CNAME verified, email.newsletter.postcolonialpolitics.org, not sure why I have email in the front but in any case I turned off tracking b/c it screws up the links embedded in the emails.

My DMARC record is “Unconfigured” and I don’t know why.

Please someone help! What am I missing?

The documentation on this is very very sparse Email Newsletters - Ghost Developer Docs. & Configuration - Ghost Developer Docs there’s no example of how the config should look for bulk email, let alone bulk email & transactional (both pretty essential) And this Configuration - Ghost Developer Docs just explains “why mailgun”but not “how mailgun”

Let me demystify one thing for you - the “mail” config block you’re sharing here is for transactional email only.

Bulk email (newsletters) are sent using the API Keys in the UI as documented here:

That’s why there’s no config docs for bulk mail - there is no config, only the region, domain and api key settings in the UI.

I can see the logs are pretty unhelpful, but it seems sending is failing completely so I’d focus on tweaking the settings in the UI and seeing if you get anything different out of the logs.

Hi Hannah,

Thanks for you response!

I’ve tried both the “sending api key” and the regular “api key” linked to in the ghost-cli from Mailgun. I’m not sure what else I can tweak.

The log says statusCode: 500 and failed \ Mailgun Error 420: Domain newsletter.postcolonialpolitics.org is not allowed to send: recipient limit exceeded. But I only have 59 recipients? And according the Mailgun dashboard I’ve only sent 15 emails - me testing the transactional emails.

{"name":"Log","hostname":"postcolonial-ubuntu-s-1vcpu-1gb-lon1-01","pid":61370,"level":50,"version":"6.0.9","err":{"id":"27f48d10-93d9-11f0-8b31-7757e469525f","domain":"https://postcolonialpolitics.org","code":"BULK_EMAIL_DB_RETRY","name":"EmailError","statusCode":500,"level":"normal","message":"[BULK_EMAIL_DB_RETRY] Sending email batch 68caaecf0698b1e98783b37a  - Failed (1st try)","context":"\"Mailgun Error 420: Domain newsletter.postcolonialpolitics.org is not allowed to send: recipient limit exceeded, try again after Wed, 17 Sep 2025 15:16:03 UTC\"","help":"\"https://ghost.org/docs/newsletters/#bulk-email-configuration\"","stack":"EmailError: status code 420: Domain newsletter.postcolonialpolitics.org is not allowed to send: recipient limit exceeded, try again after Wed, 17 Sep 2025 15:16:03 UTC\n    at BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:639:32)\n    at MailgunEmailProvider.send (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/MailgunEmailProvider.js:153:30)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async SendingService.send

Is there another setting in the UI I should be checking?

Thanks,

Allison

7 hours later and I’m still getting the same error. What I’ve done:

I am using an API key generated from here Mailgun by Sinch per this forum post Unable to send newsletter with correct Mailgun API Keys - #6 by CoinMover .

I did notice that for some reason my Mailgun account was set to the US even though the domain (newsletter.postcolonialpolitics.org) has the EU flag next to it. I changed everything to the EU and created a new api key after. The only thing I couldn’t change was the sandbox domain, I can’t delete it or change the region. Could it be the issue? I suggested changing everything over the US to the AI I was troubleshooting with and it was very against it because all of the DNS records etc. are correct.

I added my IP address to the “whitelist” Mailgun by Sinch

Speaking of, the DKIM and SPF records are active and verified respectively.

Both MX Receiving records are verified and point to mxa.eu.mailgun.org and mxb.eu.mailgun.org

The CNAME, host name: email.newsletter.postcolonialpolitics.org and value: eu.mailgun.org is verified.

The DMARC record is configured.

I set a message limit of 1000 in case that was an issue with Mailgun.

I’ve quadruple checked five times over the Bulk Email settings in the UI

I stopped ghost and shut down the droplet, tried again same error.

curl -s -u 'api' \
    https://api.eu.mailgun.net/v3/newsletter.postcolonialpolitics.org/messages \
    -F from='no-reply@newsletter.postcolonialpolitics.org' \
    -F to='me@gmail.com' \
    -F subject='Test' \
    -F text='Testing'

The above code work fine so it doesn’t seem to be an issue with the API key.

I haven’t deleted the entire ghost install and reinstalled it.

The error code is below. There’s no way to tell from it that it is definitely using the api.eu.mailgun.net but I guess it is.

Claude the AI wants me to try Ghosler with AWS SES. I’d rather not.

But what, what on earth is wrong? I only have 59 recipients. I’ve only sent 18 test emails this month.

EmailError: status code 420: Domain newsletter.postcolonialpolitics.org is not allowed to send: recipient limit exceeded, try again after Wed, 17 Sep 2025 22:41:22 UTC
    at BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:639:32)
    at MailgunEmailProvider.send (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/MailgunEmailProvider.js:153:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async SendingService.send (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/SendingService.js:128:16)
    at async response.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:451:24)
    at async BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:618:30)
    at async BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:653:20)
    at async BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:653:20)
    at async BatchSendingService.retryDb (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:653:20)
    at async BatchSendingService.sendBatch (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:450:30)
    at async runNext (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:387:21)
    at async Promise.all (index 0)
    at async BatchSendingService.sendBatches (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:395:9)
    at async BatchSendingService.sendEmail (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:213:9)
    at async BatchSendingService.emailJob (/var/www/postcolonialpolitics/versions/6.0.9/core/server/services/email-service/BatchSendingService.js:158:13)
    at async /var/www/postcolonialpolitics/versions/6.0.9/node_modules/@tryghost/job-manager/lib/JobManager.js:260:25
    at async JobManager.worker (/var/www/postcolonialpolitics/versions/6.0.9/node_modules/@tryghost/job-manager/lib/JobManager.js:16:22)

Bingo. New Mailgun accounts are pretty severely throttled. Your limit is probably somewhere in the neighborhood of 10 recipients. You can contact Mailgun support, which will likely tell you to do your normal sending (while not exceeding that limit) for a few days, and then the limit will go up. (Hint: You can put a label on groups of members, so that you’re only sending to 10 members at a time, by selecting “specific people” to send to, instead of all free users, for example.)

Thank you. But okay, I was able to send a “fake newsletter” to “specific people” which was just me. I tried add another email address, such that there might be some semblance of “bulk” but I got an error – hoping all this hasn’t introduced another issue. It worked. But technically I’ve had the account with Mailgun since February of 2024 but it didn’t work before and I gave up. How long before I can send something to my measly 59 subscribers? We don’t actually write a “newsletter” as such, we just want to notify people of new posts once every couple of weeks or months, so I can’t exactly make groups of 10, to send things out.

Thank you Cathy, really thought I was losing my mind there for a bit. I got it to work with two emails… my transactional email config was a casualty in all the API key turn over. Its a little wild that I didn’t see this throttle situation come up in any other posts :face_with_spiral_eyes:

Not at all helpful but …

“Bulk email using Mailgun can’t escape” sums up just how I felt when I finished installing my Ghost instance at blog.disintermedia.net.nz and realised I can’t send email to subscribers who’ve asked for them, without paying MailGun for the privilege. Thanks, I hate it : P

1 Like