Email Sending & MailDev Workflow
This environment routes all transactional mail through the local MailDev SMTP sink so we can test WooCommerce notifications without delivering anything to real customers.
Architecture Overview
- MailDev container (
docker-compose.yml, servicemaildev)- Image:
ghcr.io/wilsonify/maildev/maildev:2.2.1 - SMTP listener:
maildev:1025 - Web UI: exposed on your host at
http://localhost:31080
- Image:
- WordPress container
- Runs the WP Mail SMTP plugin.
- Plugin is configured to use the SMTP mailer pointing at MailDev (host
maildev, port1025, no TLS, no auth). - From address defaults to
[email protected].
Because MailDev captures messages in-memory, nothing leaves the workstation. When you need to resend email through a real ESP (SendGrid, SES, etc.), swap the WP Mail SMTP settings.
Verifying the Configuration
1. Inspect WP Mail SMTP options
cd /mnt/SSD1/mrepos/bitbucket.org/wilsonify/renewed-renaissance-woocommerce
docker compose run --rm wordpress wp option get wp_mail_smtp
You should see mailer => smtp, host => maildev, port => 1025, and auth => false. If not, apply the default profile:
docker compose run --rm wordpress wp option update wp_mail_smtp '{"mail":{"from_email":"[email protected]","from_name":"Renewed Renaissance","mailer":"smtp","return_path":true,"from_email_force":true,"from_name_force":false},"smtp":{"host":"maildev","port":1025,"encryption":"none","autotls":false,"auth":false,"user":"","pass":""},"general":{"summary_report_email_disabled":false}}' --format=json
2. Run the WP-CLI doctor check
docker compose run --rm -e WP_CLI_PACKAGES_DIR=/var/www/html/.wp-cli/packages wordpress \
wp doctor check wp-mail-smtp-mailer --config=wpdoctor/doctor.yml
A success status confirms the MailDev mailer is wired up.
3. Send a test email
- Browse to
https://www.renewed-renaissance.com/wp-admin/admin.php?page=wp-mail-smtp-tools&tab=test - Send a test message to any address.
- Open
http://localhost:31080to view the MailDev inbox.
Troubleshooting Checklist
| Symptom | Checks |
|---|---|
| No emails appear in MailDev | docker compose ps maildev (should be Up), then docker compose logs maildev --tail=200. |
| WP Mail SMTP warns "mailer setup incomplete" | Re-run the option update command or configure the plugin through the admin UI. |
| Test email fails with connection errors | Confirm wordpress container can resolve maildev: docker compose exec wordpress ping -c1 maildev. |
| Need to deliver real emails | Replace SMTP settings with your production ESP credentials, revert to MailDev afterward. |
Operational Tips
- MailDev wipes its in-memory store whenever the container restarts. Export important test emails via the Web UI.
- Automate regression checks by adding the doctor command to CI pipelines.
- The
maildevservice is intentionally not exposed publicly—only the web UI is mapped tolocalhost:31080.