Swap your fake SMTP server for Buggregator on port 1025
Already send dev mail to a fake SMTP server on port 1025? Stop it and start Buggregator in its place. Buggregator's SMTP server listens on the same port 1025, so your apps keep their mail host and port, and nothing in their config changes. The emails show up in the Buggregator UI on port 8000, next to your errors, logs and dumps.
Steps
1. Stop the old server
Only one program can listen on port 1025. If it is still taken, the binary stops at start with failed to start TCP servers and address already in use, and docker run refuses with port is already allocated.
2. Start Buggregator on the same port
With Docker:
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-p 127.0.0.1:1025:1025 \
ghcr.io/buggregator/server:latestOr as one binary, without Docker:
buggregator -http-addr 127.0.0.1:8000 -smtp-addr 127.0.0.1:10253. In Docker Compose, swap only the image
Keep the service's name, so your apps still reach it by the same host name. Change the image and the ports.
services:
mail:
image: ghcr.io/buggregator/server:latest
ports:
- 127.0.0.1:8000:8000 # UI
- 127.0.0.1:1025:1025 # SMTPHere the service is called mail; keep whatever name yours has. Your apps' MAIL_HOST=mail or MAILER_DSN=smtp://mail:1025 stays as it is.
4. Check the SMTP user name
Buggregator accepts any user name and password, or none. A user name picks the project the email lands in: with MAIL_USERNAME=shop, the email goes to the project shop. Without one, it goes to default.
5. Open the inbox
Send an email from your app and open http://127.0.0.1:8000. Each email shows its HTML preview with a desktop and mobile width switch, the plain text, addresses, attachments and raw source.
Why it works
Your app only knows a host and a port for SMTP. Buggregator answers on that same port 1025 and stores each email instead of delivering it, so the app cannot tell the difference. Its web UI and testing API run on port 8000, where tests can wait for an email with GET /api/smtp/messages/wait.
Related tips
- Mail
Catch dev email in docker-compose with one service
Add Buggregator as a service in docker-compose.yml and set your app's mail host to its service name. Every email lands in the UI on port 8000.
- Mail
A fake SMTP server as one binary, no Docker
Install one Buggregator binary, run it, and point your app's SMTP at 127.0.0.1:1025. Every email lands in a browser inbox on port 8000.
- Mail
Check an HTML email at phone width before it ships
Send your app's email to Buggregator on port 1025, then switch the HTML preview between Desktop, Tablet and Mobile width. Nothing reaches a real inbox.
- Mail
One email sandbox for the whole team
Run one Buggregator in Kubernetes with the Helm chart. Each app sends mail to its own project, and the team signs in to the inbox with SSO.
Checked on with Buggregator v2.13.0