Postfix Filters and header_checks
tyler at tylers.org
Mon Aug 15 15:01:35 MDT 2005
On 08/15/05 13:57, Dennis wrote:
> Anybody know how to get a filter to work with postfix?
> Here is what I want..
> /Match Something/ FILTER ??:??
> All the documentation I find for the header_checks just says foo:bar
> where I put ??:??. I just want to execute a script with the mail as the
> input and then have the mail delivered unaltered. So what is foo:bar
> supposed to really be? The docs/man pages say it's
> transport:destination but I'm having trouble figuring out how to make
> transport:destination into path/args for my script.
> Any thoughts?
As mentioned in another reply, the setup is the same as for
content_filter. My setup for content_filter is thus:
content_filter = amavisd-new:[127.0.0.1]:10024
amavisd-new is foo, the rest is bar. amavisd-new references an entry in
your master.cf file. Mine, for example, is:
amavisd-new unix - - n - 2 lmtp
As you can see, postfix passes the message to amavisd-new via LMTP.
Amavisd-new then scans the message (using clamav) and returns clean
messages to a smtpd process listening on port 10025 as started by this
127.0.0.1:10025 inet n - n - - smtpd
That smtp process sends the message on to its final destination, be that
locally (though your mail delivery agent (MDA)) or externally.
If you're only concerned about incoming messages, another option you may
want to look into is sending the message to your filter using your MDA,
which is probably procmail or maildrop. They both provide ample
functionality for passing a message to an external filter. I can walk
you through setting up the filter in Maildrop if you like. I'm sure
others here have procmail experience they can contribute.
More information about the PLUG