Issue with postfix after switch from ports to package

Hi,
I manage a server with FreeBSD 11.1-RELEASE-p9.
Basically it is a mailserver with mail/postfix, mail/dovecot and mail/roundcube.

I decided to switch from ports to packages with these commands:

pkg-static install -f pkg
pkg upgrade -f


I got no errors, anyway it seems mail/postfix is broken now:

Code:
Apr 11 20:27:36 mail postfix/trivial-rewrite[9193]: warning: hash:/usr/local/etc/postfix/virtual/domain.com is unavailable. open database /usr/local/etc/postfix/virtual/domain.com.db: Invalid argument
Apr 11 20:27:36 mail postfix/trivial-rewrite[9193]: warning: virtual_alias_domains: hash:/usr/local/etc/postfix/virtual/domain.com: table lookup problem

This is postconf -m output:

Code:
btree
cidr
environ
fail
hash
inline
internal
memcache
pcre
pipemap
proxy
randmap
regexp
socketmap
static
tcp
texthash
unionmap
unix

Any suggestion?
 
It's better to use the ports if you need some custom options in postfix. For your problem first open /usr/local/etc/postfix/main.cf and correct your virtual_alias_domains. It's pointing to non-existing db at /usr/local/etc/postfix/virtual/domain.com. If the file location is correct, check its content. Then you can try to rebuild the domain.com.db with postmap(1).
 
Just running pkg upgrade is not the right way to move from ports to packages. What guarantee do you have that Postfix got reinstalled again? (edit) => Only applies without -f.

Upgrade only upgrades if there is a new version available. And fact of the matter is that the ports collection is always ahead of everything. As such my theory: you reinstalled dependencies of Postfix without reinstalling Postfix itself and the result can be seen above.

The only solid way to move from ports to packages is to deinstall everything, and then re-install it:
Code:
# pkg info -aqo > packages
# pkg delete -a
# pkg install `cat packages`
 
Just running pkg upgrade is not the right way to move from ports to packages. What guarantee do you have that Postfix got reinstalled again?
The fact that he did pkg upgrade -f, instead of just pkg upgrade. The -f option always reinstalls everything.

Code:
     -f, --force
                 Force the reinstallation or upgrade of the whole set of
                 packages.
pkg-upgrade(8).
 
Code:
# pkg info -aqo > packages
# pkg delete -a
# pkg install `cat packages`

ShelLuser, thank you for this. You have no idea how many times I've tediously crawled through this procedure by hand hahahaha; I hadn't managed to brew up enough ambition to find a better way, so I find the elegance of your approach totally ironic.
 
It's better to use the ports if you need some custom options in postfix. For your problem first open /usr/local/etc/postfix/main.cf and correct your virtual_alias_domains. It's pointing to non-existing db at /usr/local/etc/postfix/virtual/domain.com. If the file location is correct, check its content. Then you can try to rebuild the domain.com.db with postmap(1).

In addiction, I just remembered that I needed to use postfix-sasl package :)

Code:
Apr 12 01:15:07 mail postfix/smtpd[13275]: warning: SASL: Connect to smtpd failed: No such file or directory
Apr 12 01:15:07 mail postfix/smtpd[13275]: fatal: no SASL authentication mechanisms

Solved with:

Code:
# pkg delete postfix
# pkg install postfix-sasl-3.3.0_1
 
Back
Top