3 # postfix This shell script takes care of starting and stopping
6 # chkconfig: 2345 80 30
8 # description: Postfix is a Mail Transport Agent, which is the program
9 # that moves mail from one machine to another.
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
19 [ -f /etc/sysconfig/postfix ] && . /etc/sysconfig/postfix
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23 msg_Network_Down Postfix
27 # See how we were called.
30 # Check if the service is already running?
31 if [ ! -f /var/lock/subsys/postfix ]; then
34 MSG="`/usr/sbin/postfix start 2>&1`"
35 if [ "$?" = "0" ] ; then
37 touch /var/lock/subsys/postfix
43 msg_Already_Running Postfix
48 if [ -f /var/lock/subsys/postfix ]; then
51 MSG="`/usr/sbin/postfix stop 2>&1`"
52 if [ "$?" = "0" ]; then
58 rm -f /var/lock/subsys/postfix
60 msg_Not_Running Postfix
69 /usr/sbin/postfix reload
76 standard_db="access canonical relocated transport virtual"
77 extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | sed -e 's#.db$##')
78 for base in $standard_db $extra_db; do
80 if [ -f /etc/mail/$I ] ; then
81 /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
86 msg_Usage "$0 {start|stop|status|restart|reload|rebuilddb}"