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 -a "$1" != stop -a "$1" != status ]; 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`"
42 touch /var/lock/subsys/postfix
49 msg_already_running Postfix
54 if [ -f /var/lock/subsys/postfix ]; then
57 MSG="`/usr/sbin/postfix stop 2>&1`"
64 rm -f /var/lock/subsys/postfix
66 msg_not_running Postfix
75 if [ -f /var/lock/subsys/postfix ]; then
77 daemon /usr/sbin/postfix reload
79 [ $RETVAL -ne 0 ] && RETVAL=7
81 msg_not_running Postfix
90 standard_db="access canonical relocated transport virtual"
91 extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | grep -v aliases.db | sed -e 's#.db$##')
92 for base in $standard_db $extra_db; do
94 if [ -f /etc/mail/$I ]; then
95 /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
101 msg_usage "$0 {start|stop|restart|reload|force-reload|rebuilddb|status}"