I have a server running postfix with ~20 users that receives mail and sometimes resend the mail to external domains. Is it possible to configure postfix to drop all outgoing mail (to all users) into a folder/file, and then when I initiate it, send all mail in said folder? I want to go through all mail by hand before it is sent from the server.
1 Answer
Yes (mostly).
You'll want to setup an smtpd access(5)
policy (check_recipient_access type:table)
that sends items into the hold queue
, probably in smtpd_recipient_restrictions
.
The message queue can be seen with postqueue -p
.
Messages in the hold queue are denoted by a trailing !
on their QUEUEID, e.g.:
19ABE1094521! 49261 Mon Nov 14 20:59:59 MAILER-DAEMON
The contents of held messages can be sent to stdout using postcat -q $QUEUEID
.
Held messages may be released using postsuper -H $QUEUEID
, requeued using postsuper -r $QUEUEID
, or deleted using postsuper -d $QUEUEID
.
-
Great! Exactly what I was looking for but didn't think about. I was totaly into "put stuff here - read - refeed to postfix"– ExostorNov 21, 2016 at 10:19