Re: Re[2]: postfix content filter

From: Jim Breton (jamesb-lists@private)
Date: Mon Mar 10 2003 - 00:23:39 PST


On Mon, Mar 10, 2003 at 01:25:23PM +0600, Dmitriy Litovchin wrote:
> My trouble is - I want to filter all mail that goes through smtp -
> incoming (even that not stores localy) and outgoing.

Ah, OK.

Fwiw, my setup works the way you want yours to work, but this is what it
looks like:

1. Postfix SMTPD accepts incoming mail, does a bunch of RBL and other
	checks
2. mail is piped to procmail (defined in a Postfix transport)
	- after this point, Postfix never sees the mail again
3. procmail filters message through SpamAssassin, then gives the mail
	to /usr/sbin/sendmail for further delivery
4. /usr/sbin/sendmail is owned by qmail, which handles local and outbound
	final delivery

Basically it's just an SMTP proxy.


Now if you didn't want to do that, then perhaps the following would work:
1. same as above
2. same as above
3. procmail | /usr/sbin/sendmail (owned by Postfix)
	- this might be all you need to do, but I am not sure whether
	Postfix will do another transport lookup.  If it does, you're
	screwed.  If not, then you should be all set, letting Postfix
	decide what to do with the message (remote or local final
	delivery).
		- or maybe you could have another transport with a bogus
		domain and do some address rewriting to use it but that is
		ugly and I wouldn't feel comfortable with that


Another option:
Do the same thing I do with qmail, except run a 2nd instance of Postfix
with its own configs, and without the procmail transport.  So a message
comes in, is filtered, then passed to /usr/sbin/sendmail which is your 2nd
Postfix; from here, you make your normal delivery decisions.
	- or perhaps you could do this within one instance of Postfix, but
	with 2 queues, one of them having transport lookups disabled.



This archive was generated by hypermail 2.1.3 : Sun Jan 15 2006 - 13:43:18 PST