annotate dnsbl.rc.in @ 266:582cfb9c4031 stable-6-0-33

fix unauthenticated rate limit bug for empty mail from
author Carl Byington <carl@five-ten-sg.com>
date Sat, 21 Jul 2012 13:05:54 -0700
parents 4db1457cd11a
children df7dc6b2b153
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
163
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
1 #!@BASH@
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
2 #
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
3 # dnsbl This script controls the dnsbl milter daemon.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
4 #
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
5 #
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
6 # chkconfig: 2345 79 31
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
7 # description: dnsbl is an interface between MTA and the various dns blocking lists
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
8 # processname: dnsbl
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
9 # pidfile: /var/run/dnsbl.pid
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
10 # Source function library.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
11 #
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
12 . /etc/rc.d/init.d/functions
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
13
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
14 # Source networking configuration.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
15 . /etc/sysconfig/network
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
16
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
17 RETVAL=0
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
18 # See how we were called.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
19 case "$1" in
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
20 start)
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
21 # Start daemons.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
22 echo -n "Starting dnsbl-milter: "
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
23 if [ ! -f /var/lock/subsys/dnsbl ]; then
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
24 cd SYSCONFDIR/dnsbl # conf file is here
178
d6531c702be3 embedded dcc filtering
carl
parents: 163
diff changeset
25 DCCIFD=
d6531c702be3 embedded dcc filtering
carl
parents: 163
diff changeset
26 [ -S /var/dcc/dccifd ] && DCCIFD='-b /var/dcc/dccifd'
d6531c702be3 embedded dcc filtering
carl
parents: 163
diff changeset
27 SBINDIR/dnsbl -d 10 $DCCIFD -r /var/run/dnsbl/dnsbl.resolver.sock -p local:/var/run/dnsbl/dnsbl.sock
163
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
28 RETVAL=$?
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
29 pid=`pidof -s SBINDIR/dnsbl`
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
30 if [ $pid ]
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
31 then
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
32 success "Starting dnsbl milter:"
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
33 touch /var/lock/subsys/dnsbl
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
34 echo
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
35 else
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
36 failure "Starting dnsbl milter:"
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
37 echo
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
38 fi
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
39 else
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
40 echo -n "already running! "
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
41 failure "dnsbl milter already running!"
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
42 echo
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
43 fi
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
44
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
45 ;;
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
46 stop)
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
47 # Stop daemons.
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
48 echo -n "Shutting down dnsbl-milter: "
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
49 killproc dnsbl
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
50 RETVAL=$?
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
51 echo
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
52 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
53 ;;
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
54 restart|reload)
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
55 $0 stop
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
56 $0 start
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
57 RETVAL=$?
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
58 ;;
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
59 status)
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
60 status dnsbl
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
61 RETVAL=$?
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
62 ;;
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
63 *)
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
64 echo "Usage: dnsbl {start|stop|restart|status}"
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
65 exit 1
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
66 esac
97d7da45fe2a spamassassin changes
carl
parents:
diff changeset
67 exit $RETVAL