First, if you get this, make sure that you actually have installed the required components (whichever you are missing):

apt install postfix-mysql
apt install postfix-pcre

…but my real point here, is that it seems that some (at least it happens on Ubuntu 20) have an issue by missconfiguring the file in the /etc/postfix directory.

Namely, when you install eg. both extensions, the config file looks like this:

# dict-type	so-name (pathname)	dict-function	mkmap-function
pcre		        dict_pcre_open	
mysql		dict_mysql_open	

So, all seems to be allright, except that it’s still throwing the error above. The problem is, that this way it’s looking for the plugin files inside the postfix directory, and since it can’t find them, it can’t find them it still throws the same error. The solution is to add absolute paths to the .so files, which in case of Ubuntu is /usr/lib/postfix/ so, the file should look like this:

# dict-type	so-name (pathname)	dict-function	mkmap-function
pcre	/usr/lib/postfix/		dict_pcre_open	
mysql	/usr/lib/postfix/		dict_mysql_open	

Restart Postfix, and voila, problem solved.
This one was driving me crazy…

2 thoughts on “Debian/Ubuntu – unsupported dictionary type: pcre or mysql with Postfix

  1. Hi!

    Judging from the postfix-pcre.prerm, if you change the path, it won’t be deleted after you remove postfix-pcre package. That can cause similar problems.
    See /usr/share/postfix/postinst.functions, delmap() function.

  2. Here it is, March 2024, and this problem still rears its ugly head. Thank you very much for posting this fix!

    I got the “unsupported dictionary type” error after an “unattended upgrade” on Debian 10 a couple of months ago. I got mysql lookups to work using your fix (from another source), but pcre would not work. I finally disabled pcre table lookups in my postfix config.

    Then yesterday I finally upgraded to Debian 11. I remembered the path fix in, but couldn’t remember the path to use to the plugin files. I found your post and this time, after the upgrade to Debian 11, it fixed both the mysql and the pcre plugins!

    Note that Postfix shouldn’t look for these files in the “queue_directory” unless it is configured to use chroot in In fact, chroot is supposed to not be the default after postfix v3. But even so, even though all my settings have chroot off, postfix was evidently looking for the pcre and mysql plugin files in the “queue_directory”, and only stopped doing so when the full path to the files is given, as you indicated.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.