postfix queue debug and mock smtp servers
To create and test a monitoring plugin for Postfix, I had to force Postfix to queue some messages.
I looked at several Mock SMTP Servers
I ended up using Postfix's own features.
Defer All Messages
postfix/main.cf
default_transport = defer
Defer Some Messages
postfix/main.cf
transport_maps = hash:/etc/postfix/transport
postfix/transport
.example.com error:
example.com defer:
sources:
- Use Postfix Transport Map & Relayhost Map For Flexible Email Delivery by Xiao Guoan
- Fake SMTP server with Python by Stuart Colville
- E-mail Testing with Mock SMTP Server by Maciek Makowski
- Postfix Manual - transport(5)
- RFC5321 Simple Mail Transfer Protocol
- smtpd – SMTP Server – Python 4 Documentation