18 lines
407 B
Plaintext
18 lines
407 B
Plaintext
|
#!/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 $?
|