Drupal mail to a local inbox
On Drupal 10.2 or newer, add two settings to settings.php: use core's symfony_mailer mail plugin, and point its SMTP transport at 127.0.0.1, port 1025. Every email your site sends then lands in Buggregator: account mails, password resets, contact forms. Nothing reaches real users.
Steps
1. Start Buggregator
Run the container. Port 8000 is the web UI, port 1025 is the SMTP server.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-p 127.0.0.1:1025:1025 \
-p 127.0.0.1:9912:9912 \
-p 127.0.0.1:9913:9913 \
ghcr.io/buggregator/server:latest2. Switch to core's Symfony mailer
Drupal 10.2 added a mail plugin built on Symfony Mailer. Drupal still marks it experimental. Turn it on in settings.php, or in settings.local.php so it stays on your machine:
$config['system.mail']['interface'] = ['default' => 'symfony_mailer'];3. Point the SMTP transport at Buggregator
In the same file, set the transport. No user, password or TLS is needed.
$config['system.mail']['mailer_dsn'] = [
'scheme' => 'smtp',
'host' => '127.0.0.1',
'port' => 1025,
];If Drupal runs in Docker next to Buggregator, use the Buggregator service name as the host, for example buggregator.
4. Send an email and open it
Request a password reset or submit a contact form. Open http://127.0.0.1:8000. You see the rendered email, the addresses, the attachments and the raw MIME source.
Why it works
Buggregator includes a fake SMTP server on port 1025. Drupal's SMTP transport delivers to it like to any mail server, and Buggregator stores the email and shows it in the UI instead of sending it on. Because the change sits in settings files, the site's own mail configuration in the database stays as it is.
Source: the Drupal change record for the Symfony mailer plugin.
Related tips
- Mail
WordPress mail from a local site, caught
A small mu-plugin sends WordPress mail to Buggregator on 127.0.0.1:1025, only when WP_ENVIRONMENT_TYPE is local. Nothing reaches real users.
- Mail
Magento 2 email to a local inbox
Set Magento's mail transport to SMTP on 127.0.0.1:1025. Order, invoice and account emails land in Buggregator with HTML preview; none are delivered.
- 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
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.
Checked on with Buggregator v2.13.0