#!/bin/sh
#
# $OpenBSD: postfix-enable,v 1.7 2014/04/02 00:33:09 brad Exp $

if [ -f /etc/mailer.conf.postfix ]; then
    if [ -f /etc/mailer.conf ]; then
        mv -f /etc/mailer.conf /etc/mailer.conf.pre-postfix
        echo "old /etc/mailer.conf saved as /etc/mailer.conf.pre-postfix"
    fi
    mv -f /etc/mailer.conf.postfix /etc/mailer.conf
    echo "postfix /etc/mailer.conf enabled"
    echo ""
    echo "NOTE: do not forget to add smtpd_flags=NO to"
    echo "      /etc/rc.conf.local to disable smtpd." 
    echo ""
    echo "NOTE: do not forget to add \"-a /var/spool/postfix/dev/log\" to"
    echo "      syslogd_flags in /etc/rc.conf.local and restart syslogd."
    echo ""
    echo "NOTE: do not forget to add postfix to pkg_scripts in"
    echo "      /etc/rc.conf.local to start postfix automatically." 
else
    echo "can't find /etc/mailer.conf.postfix, postfix not enabled"
fi
