~ubuntu-branches/ubuntu/dapper/sendmail/dapper-security

« back to all changes in this revision

Viewing changes to debian/local/socks_wrapper

  • Committer: Bazaar Package Importer
  • Author(s): Richard A Nelson (Rick)
  • Date: 2004-12-15 19:30:00 UTC
  • Revision ID: james.westby@ubuntu.com-20041215193000-3v70qonkis3occ36
Tags: 8.13.2-1
* New upstream release
  - DB termination before exit (vacation, mail.local)
  - threading for milter
  - DNS for IPv6 and SASL
  - Cyrus IMAP LMTP and AUTH
  - see Changelog for the details
* Refresh FAQ

Show diffs side-by-side

added added

removed removed

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