postfixadmin/VIRTUAL_VACATION/mail-filter

18 lines
407 B
Plaintext
Raw Normal View History

2022-07-30 18:50:24 +02:00
#!/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 $?