I am running postfix with virtual domains and I have SA working vi a re-injection script and a second smtpd listener:
---- % cat /usr/local/bin/spamfilter.sh #!/bin/sh # spamfilter.sh by SecuritySage (http://www.securitysage.com) # SpamAssassin Only
INSPECT_DIR=/var/delivery SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/local/bin/spamc
EX_TEMPFAIL=75 EX_UNAVAILABLE=69
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15
cat | $SPAMASSASSIN -f > out.$$
# invoke formail/procmail here
perl /usr/local/bin/reinject "$@" < out.$$
exit $? ----
This all works fine, but I want to pipe the message through procmail after it hits spamassassin (I have a recipe that checks for the level of spamishness, deletes high scoring spam, and marks low scoring spam as read). I simply used to use procmail as the mailbox_transport, but I can't do that with virtual.
My problem is not the command to invoke procmail, but how to prevent procmail from delivering the message and instead making its changes to the out.$$ file.
If I do:
# invoke formail/procmail here /usr/local/bin/procmail -m /var/delivery/.procmailrc < out.$$
out.$$ doesn't get modified, of course. In fact, the message as piped though procmail seems to simply vanish.
if I try:
# invoke formail/procmail here formail -s procmail -m /path/to/rcfile < out.$$ > pm.$$
then the pm.$$ is just a 0 length file
Anyone done something like this before?
--
"Ironically, they lost the gigahertz game," he said of Intel. "(The G5) is extremely faster than the Itanium II, hands down." - Srinidhi Varadarajan, Virginia Tech
