#!/bin/sh
# I should be called by qmail-smtpd or anything that calls qmail-queue
#
out=`/bin/mktemp -t surblXXXXXXXXXX`
if [ $? -ne 0 ] ; then
	exit 111
fi
#
# Redirect standard error to 4 so that qmail_open() will pick up the error
#
/var/qmail/bin/surblfilter > $out 2>&4
status=$?
if [ $status -eq 0 ] ; then
	exec 0<$out
	/bin/rm -f $out
	exec /var/qmail/bin/qmail-queue
else
	/bin/rm -f $out
	exit $status
fi
