2
# Richard Nelson <cowboy@debain.org>
3
# Socks5 support wrapper for sendmail
5
DAEMON=/usr/sbin/sendmail.real
6
RUNSOCKS=/usr/bin/runsocks
7
BASENAME=$(basename $0)
9
# Adjust command name based upon the presence of the socks5 wrapper
10
if [ -x $RUNSOCKS ]; then
11
COMMAND="$RUNSOCKS $DAEMON"
15
#echo "$BASENAME command="$COMMAND
17
# Exec the appropriate command
19
# These don't need socks support, and must be called by name
20
"hoststat" | "mailq" | "newaliases" | "purgestat")
21
exec -a $BASENAME $DAEMON "$@"
23
# These need socks support
25
exec -a $DAEMON $COMMAND "$@"
27
# Help... shouldn't be here
29
echo "panic, $BASENAME is not a valid alias for sendmail."