On Wed, Jan 05, 2011 at 05:25:53PM +0000, Ian Halperin wrote: > I would like postfix to send all emails received on SMTP off to an > external process, which will decide whether to allow them through as > normal, or whether to put them into the hold queue (or another > quarantine area), where they have to wait for admin approval. > > I was thinking of doing this with an after-queue content filter, which > uses pipe(8) to run a script on each message, and the script itself > will spawn "postsuper -h <queue_id>" if it decides to put the message > on hold.
No this is wrong. Just tag the message, and put appropriate header_checks in the post-filter Postfix smtpd+cleanup. I use multiple (3) instances: Input Postfix ---> Postqueue Proxy ---> Output Postfix ---> Destination | | v Quarantine Postfix The Input instance receives mail from external systems, delivers all mail that is not rejected to the Output instance via a transparent SMTP proxy that tags spam/malware/... The Output instance has header checks that "FILTER" tagged mail into a Quarantine instance which stores quarantined mail. Untagged email is delivered directly to the recipient. -- Viktor.