blob: ad89379a08df57c72bb35d88ce6c19ae7da60f10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/bin/bash
# Richard Nelson <cowboy@debain.org>
# Socks5 support wrapper for sendmail
DAEMON=/usr/sbin/sendmail.real
RUNSOCKS=/usr/bin/runsocks
BASENAME=$(basename $0)
# Adjust command name based upon the presence of the socks5 wrapper
if [ -x $RUNSOCKS ]; then
COMMAND="$RUNSOCKS $DAEMON"
else
COMMAND="$DAEMON"
fi
#echo "$BASENAME command="$COMMAND
# Exec the appropriate command
case "$BASENAME" in
# These don't need socks support, and must be called by name
"hoststat" | "mailq" | "newaliases" | "purgestat")
exec -a $BASENAME $DAEMON "$@"
;;
# These need socks support
"sendmail")
exec -a $DAEMON $COMMAND "$@"
;;
# Help... shouldn't be here
*)
echo "panic, $BASENAME is not a valid alias for sendmail."
;;
esac
|