File: socks_wrapper

package info (click to toggle)
sendmail 8.13.8-3%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,204 kB
  • ctags: 138
  • sloc: sh: 8,118; perl: 4,184; makefile: 3,810; ansic: 186
file content (31 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (11)
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