I need catch email bodies and headers that are sent by postfix on my Ubuntu server.
Could you please explain me, how to catch it?
I know I can do it by postcat (postcat -vq XXXXXXXXXX
) when message is in mail queue, but unfortunately I don't know queue ID (XXXXXXXXXX
) and when I find it, message is already sent.
for example:
echo "test message" | mail -s "test" [email protected]
service postfix stop
mailq
postcat -vq C23D82B60024
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With