- TypeScript 56%
- PHP 40.9%
- CSS 1%
- Dockerfile 0.8%
- JavaScript 0.7%
- Other 0.6%
| .github/workflows | ||
| app | ||
| bootstrap | ||
| config | ||
| database | ||
| docker/fpm | ||
| public | ||
| resources | ||
| routes | ||
| storage | ||
| tests | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .lerd.yaml | ||
| .node-version | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| artisan | ||
| bun.lock | ||
| components.json | ||
| composer.json | ||
| composer.lock | ||
| docker-compose.yml | ||
| Dockerfile | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| phpstan.neon | ||
| phpunit.xml | ||
| pint.json | ||
| README.md | ||
| rector.php | ||
| renovate.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
Mailgun Proxy for Ghost
This is Mailgun-compatible proxy built specifically for Ghost newsletters. Ghost sends newsletter mail through the proxy as if it were Mailgun; the proxy sends through Laravel and exposes Mailgun-shaped events back to Ghost analytics.
Supported Providers
- SMTP
- Sendmail
- Postmark
- Amazon SES
- Resend
- Mailbox (faking a mailbox without sending it for real, great for local testing)
- And more if you install other packages by the community
What it does
- Accepts Ghost's Mailgun
POST /v3/{domain}/messagesrequests. - Sends each recipient through Laravel's configured mailer.
- Records per-recipient deliveries and webhook events.
- Accepts Resend webhooks at
POST /api/webhook/resend. - Exposes Ghost-compatible Mailgun events at
GET /v3/{domain}/events.
Laravel environment
Add these values to the proxy .env:
APP_URL=https://newsletter-proxy.domain.tld
MAIL_MAILER=resend
OUTBOX_PROVIDER=resend
MAILGUN_API_KEY=change-this-shared-api-key
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
RESEND_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Notes:
MAILGUN_API_KEYis the shared key Ghost uses as its Mailgun API key.RESEND_API_KEYis used by Laravel's Resend mailer.RESEND_WEBHOOK_SECRETis the Svix/Resend webhook signing secret.- Set the Resend webhook URL to:
https://newsletter-proxy.domain.tld/api/webhook/resend
Enable Resend domain tracking for opens and clicks:
https://resend.com/docs/dashboard/domains/tracking
Ghost configuration
In Ghost's config file, point bulk email Mailgun settings to this proxy:
{
"bulkEmail": {
"mailgun": {
"baseUrl": "https://newsletter-proxy.domain.tld/",
"apiKey": "change-this-shared-api-key",
"domain": "domain.tld"
}
}
}
Notes:
baseUrlmust be the proxy URL and should include the trailing slash.apiKeymust matchMAILGUN_API_KEYin the proxy.env.domainshould be the Ghost newsletter sending domain.
Docker Compose setup
cp .env.example .env
# Edit .env with your configuration
docker compose up -d --build
docker compose exec app php artisan key:generate
docker compose exec app php artisan migrate
The app will be available at http://localhost:8080.
Local setup
composer install
bun install
cp .env.example .env
php artisan key:generate
php artisan migrate
Run the app and queue worker:
composer run dev
php artisan queue:work
Ghost analytics flow
Ghost polls Mailgun events from this proxy. The proxy returns stored delivery events in the shape Ghost expects, including:
deliveredopenedclickedfailedrejectedcomplained
email.sent webhooks from Resend are ignored because Laravel's MessageSent event records the initial accepted state.
Dashboard
The proxy includes a Laravel/Inertia dashboard for inspecting newsletter requests, attempts, deliveries, webhook events, and retrying failed requests.
/dashboard
License
Copyright (C) 2026 Bruno Bernard
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
Because the AGPL-3.0 covers network use, anyone who runs a modified version of this proxy as a network service must make the corresponding source available to its users.