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 but none was quite as simple as I needed.

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: