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.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down Postfix
34 if [ ! -f /var/lock/subsys/postfix ]; then
37 MSG="`/usr/sbin/postfix start 2>&1`"
40 touch /var/lock/subsys/postfix
47 msg_already_running Postfix
52 if [ -f /var/lock/subsys/postfix ]; then
55 MSG="`/usr/sbin/postfix stop 2>&1`"
62 rm -f /var/lock/subsys/postfix
64 msg_not_running Postfix
69 # See how we were called.
86 if [ -f /var/lock/subsys/postfix ]; then
88 daemon /usr/sbin/postfix reload
90 [ $RETVAL -ne 0 ] && RETVAL=7
92 msg_not_running Postfix
101 standard_db="access canonical relocated transport virtual"
102 extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | grep -v aliases.db | sed -e 's#.db$##')
103 for base in $standard_db $extra_db; do
104 I=$(basename "$base")
105 if [ -f /etc/mail/$I ]; then
106 /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
112 msg_usage "$0 {start|stop|restart|reload|force-reload|rebuilddb|status}"