On Tue, 07 May 2002 17:35:59 +0200, Northe, Juergen wrote:
>Hi !
>i was searching the web and this mailling for configuring postfix with
>anomy as a mailrelay.
>[...]
>Can anyone give me an example master.cf and main.cf ?
Following is how I got this working based on the examples that came
with Postfix. It may not be the best way to implement it but it works.
This did not seem to require any changes to the main.cf file.
I have the following mods in my master.cf (under 'filter' the
"flags=..." and "argv=..." are on the same line, although, I don't
recall if they have to be or not):
smtp inet n - y - - smtpd
-o content_filter=filter:dummy
filter unix - n n - - pipe
flags=R user=filter
argv=/path/to/anomy/bin/filter -f ${sender} ${recipient}
Then /path/to/anomy/bin/filter looks like:
(sorry for any line breaks that may cause trouble)
#!/bin/sh
# Localize these
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail
SANITIZER=/path/to/anomy/bin/sanitizer.pl
SANITIZER_CONF=/etc/sanitizer.conf
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
# Clean up when done or when aborting.
trap "rm -f *.$$" 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; }
$SANITIZER $SANITIZER_CONF <in.$$ >out.$$ || { echo Message content
rejected; exit $EX_UNAVAILABLE; }
$SENDMAIL "$@" <out.$$
exit $?
Hope this helps.
John Blumel