Jamie Bohr:
> I already have a program that works externally from Postfix.  It is
> getting it to work from within Postfix that is the issue.  Even the
> script from http://www.postfix.org/FILTER_README.html#simple_filter
> does not work.  I think there is something I need to set something in
> main.cf.

The information you give below does not cover every step of
http://www.postfix.org/FILTER_README.html#simple_filter

        Wietse

> I added the following to my master.cf per the instructions(zenoss is
> the user name)(all one line):
> 
> filter    unix  -       n       n       -       10      pipe flags=Rq
> user=zenoss argv=/tmp/tmp.filter.sh -f ${sender} -- ${recipient}
> 
> 
> 
> $ ll /tmp/tmp.filter.sh
> -r-xr-xr-x 1 zenoss users 780 Aug  6 15:51 /tmp/tmp.filter.sh
> 
> 
> /tmp/tmp.filter.sh
> ========================================================
> #!/bin/sh
> 
> # Simple shell-based filter. It is meant to be invoked as follows:
> #       /path/to/script -f sender recipients...
> 
> # Localize these. The -G option does nothing before Postfix 2.3.
> INSPECT_DIR=/var/spool/filter
> SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
> 
> # Exit codes from <sysexits.h>
> EX_TEMPFAIL=75
> EX_UNAVAILABLE=69
> 
> # Clean up when done or when aborting.
> #trap "rm -f in.$$" 0 1 2 3 15
> 
> # Start processing.
> cd $INSPECT_DIR || {
>     echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
> 
> cat >in.$$ || {
>     echo Cannot save mail to file; exit $EX_TEMPFAIL; }
> 
> # Specify your content filter here.
> # filter <in.$$ || {
> #   echo Message content rejected; exit $EX_UNAVAILABLE; }
> cat in.$$ > /tmp/tmp.msg.$$
> 
> $SENDMAIL "$@" <in.$$
> 
> exit $?
> ========================================================
> 
> No thing gets generated in /tmp or /var/spool/filter

Reply via email to