I've had this server in use for something like a week. Fresh Ubuntu 20.04 install, packages all installed through apt. I could receive and send mail outside of my IP just fine. Suddenly, receiving e-mail was not longer possible.
I checked the logs and soon noticed the error: unsupported dictionary type: mysql message, which meant that postfix was unable to check the recipient against my database. I checked my apt list --installed output, but postfix-mysql was installed, so that wasn't the problem. I soon discovered I needed to add the line:
mysql /usr/lib/postfix/postfix-mysql.so.1.0.1 dict_mysql_open
to /etc/postfix/dynamicmaps.cf and do a postfix reload.
My question is: how could this happen? I do have an apt update && apt upgrade cron running that auto-updates the server.
Update
The last update I saw was this one:
2021-09-28 23:01:31 upgrade postfix:amd64 3.4.13-0ubuntu1.1 3.4.13-0ubuntu1.2
The problems started right after that. dynamicmaps.cf was empty except for the commented instruction-line at the top. I added the mysql-line, and now that is the only functional line in the file.
Update 2
After killing all the processes found with ps -Af | grep -E 'dpkg|debconf|apt|unatt' I ran:
sudo apt update
sudo apt-get install --fix-broken
sudo dpkg --configure -a -D223
Which gave me the following error when trying to configure postfix:
D000001: process queue pkg postfix-mysql:amd64 queue.len 54 progress 1, try 1
dpkg: dependency problems prevent configuration of postfix-mysql:
postfix-mysql depends on postfix (= 3.4.13-0ubuntu1.2); however:
Package postfix is not installed.
dpkg: error processing package postfix-mysql (--configure):
dependency problems - leaving unconfigured
I don't know enough about dpkg to understand this. What's happening here?
Update 3
dpkg-query --show --showformat='${package} ${status}\n' 'postfix*'
yields:
postfix install ok installed postfix-cdb unknown ok not-installed
postfix-doc unknown ok not-installed
postfix-ldap unknown ok not-installed
postfix-lmdb unknown ok not-installed
postfix-mysql install ok installed
postfix-pcre unknown ok not-installed
postfix-pgsql unknown ok not-installed
postfix-sqlite unknown ok not-installed
So both requested packages are in an OK and installed status. The apt command did not suggest a fix as far as I saw (and I read the output carefully). It seems your suggestions worked.
What I don't like is not knowing what I'm doing, but that is due to my own apt and dpkg lack of knowledge.