On Fri, Mar 05, 2004 at 01:10:57PM -0500, George Georgalis wrote:
>well this setup /almost/ works. the plan is to receive email with qmail,
>use virtualdomains to deliver to a special dot-qmail file which executes
>spamassassin (spamc) and files as spam or redirects to the regular
>dot-qmail file for tmda-filter processing
my solution is to use one dot-qmail file and a wrapper for spamassassin
to provide proper qmail-command exit codes.
# .qmail-default
|preline ./bin/dot-spamc ./Mail/spamassassinated/
|preline tmda-filter
|preline procmail
|exit 99
and the ./bin/dot-spamc program
#!/bin/bash
# dot-spamc
spamdir=$1
tmp=/var/tmp/dot-spamc-$$
echo "`basename $0`"
tee $tmp </dev/stdin | spamc -c
case $? in
0) # ham
rm $tmp
exit 0 # it's ham, continue delivery
;;
1) # spam
cat $tmp | safecat ${spamdir}/tmp ${spamdir}/new >/dev/null
rm $tmp
exit 99 # it's spam, don't continue
;;
esac
rm $tmp
exit 111 # spamc failed, retry
#Error codes:
#0 successful, continue
#99 successful, stop
#100 failed permanently
#111 failed, retry
// George
--
George Georgalis, Architect and administrator, Linux services. IXOYE
http://www.galis.org/george cell:646-331-2027 mailto:[EMAIL PROTECTED]
Key fingerprint = 5415 2738 61CF 6AE1 E9A7 9EF0 0186 503B 9831 1631
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users