Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 " if it decides to put the message on hold.

Then the admin can do postsuper -d or -r to delete or pass the message on as appropriate.

So, my questions are - a) will this work, and b) is this the best way to do it? Would a milter or another type of content filter be a better approach?

share|improve this question

2 Answers 2

This is actually the way MailScanner works, so it might be an idea to have a look at the setup documentation for MailScanner/Postfix here. Basically, all email is sent to a hold queue, MailScanner scans it, and anything that's passes is put into the outbound queue.

Hopefully, ignoring the MailScanner specific parts of the doc, you'll be able to extract the Postfix setup you need.

share|improve this answer

use header_check... eg.

in main.cf file:

header_checks = regexp:/usr/local/etc/postfix/header_check

in header_check file: /Subject: Test*/ HOLD

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.