It seems there is an error in the script, which allows to get the
mailers out of sync:
# pkg_delete postfix-2.6.2
postfix/postfix-script: fatal: the Postfix mail system is not
running
postfix-2.6.2:
complete
Clean shared items:
complete
--- postfix-2.6.2 -------------------
system(/bin/sh, -c, /usr/local/sbin/postfix stop) failed: exit(1)
postfix mailer.conf disabled, old mailer.conf enabled
You should also run /usr/sbin/userdel _postfix
You should also run /usr/sbin/groupdel _postdrop
You should also run /usr/sbin/groupdel _postfix
# cat /etc/mailer.conf
sendmail /usr/local/sbin/sendmail
send-mail /usr/local/sbin/sendmail
mailq /usr/local/sbin/sendmail
newaliases /usr/local/sbin/sendmail
# ls -l /usr/local/sbin/sendmail
ls: /usr/local/sbin/sendmail: No such file or directory
So, finally postfix is enabled, but can't run, ever.
Here is how to recover:
# pkg_add -v postfix-2.6.2
[ for information:
# ls -l
/etc/mailer.conf*
-rw-r--r-- 1 root wheel 137 Nov 24 2008 /etc/mailer.conf
-rw-r--r-- 1 root wheel 137 Mar 24 13:06 /etc/mailer.conf.postfix
# diff /etc/mailer.conf /etc/mailer.conf
#
]
# cat
/var/backups/etc_mailer.conf.current
# $OpenBSD: mailer.conf,v 1.4 2009/03/16 14:26:22 jacekm Exp $
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
sendmail /usr/libexec/sendmail/sendmail
send-mail /usr/libexec/sendmail/sendmail
mailq /usr/libexec/sendmail/sendmail
makemap /usr/libexec/sendmail/makemap
newaliases /usr/libexec/sendmail/sendmail
hoststat /usr/libexec/sendmail/sendmail
purgestat /usr/libexec/sendmail/sendmail
# cp /var/backups/etc_mailer.conf.current
/etc/mailer.conf
# /usr/local/sbin/postfix-enable
old /etc/mailer.conf saved as /etc/mailer.conf.pre-postfix
postfix /etc/mailer.conf enabled
NOTE: do not forget to add sendmail_flags="-bd" to
/etc/rc.conf.local to startup postfix correctly.
NOTE: do not forget to add "-a /var/spool/postfix/dev/log" to
syslogd_flags in /etc/rc.conf.local and restart syslogd.
NOTE: do not forget to remove the "sendmail clientmqueue runner"
from root's crontab.
# reboot
And now everything is okay.
It could have been done just swapping the mailer.conf-files, but I
didn't know by then.
Chances are, the swap-the-mailer.conf should not be run blindly.
Uwe