You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postfixadmin/VIRTUAL_VACATION/mail-filter

18 lines
407 B
Bash

#!/bin/sh
FILTER_DIR=/home/vacation
SENDMAIL="/usr/sbin/sendmail -i"
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
trap "rm -f in.$$" 0 1 2 3 15
cd $FILTER_DIR || { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; }
cat > in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
/home/vacation/vacation.pl < in.$$ || { echo Message content rejected; exit $EX_UNAVAILABLE; }
$SENDMAIL "$@" < in.$$
exit $?