3 # postfix This shell script takes care of starting and stopping
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_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network ]; then
24 msg_network_down Postfix
32 # See how we were called.
35 # Check if the service is already running?
36 if [ ! -f /var/lock/subsys/postfix ]; then
39 MSG="`/usr/sbin/postfix start 2>&1`"
40 if [ "$?" = "0" ] ; then
42 touch /var/lock/subsys/postfix
48 msg_already_running Postfix
54 if [ -f /var/lock/subsys/postfix ]; then
57 MSG="`/usr/sbin/postfix stop 2>&1`"
59 if [ $RETVAL -eq 0 ]; then
65 rm -f /var/lock/subsys/postfix
67 msg_not_running Postfix
76 if [ -f /var/lock/subsys/postfix ]; then
79 /usr/sbin/postfix reload
81 [ $RETVAL -eq 0 ] && ok || died
83 msg_not_running Postfix
92 standard_db="access canonical relocated transport virtual"
93 extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | grep -v aliases.db | sed -e 's#.db$##')
94 for base in $standard_db $extra_db; do
96 if [ -f /etc/mail/$I ] ; then
97 /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
103 msg_usage "$0 {start|stop|restart|reload|rebuilddb|status}"