Postmap returns database not found error

Dave Coventry asked:

I have set up my Postfix configuration with Mysql maps, prety much as detailed here and here.

I have a file at /etc/postfix/mysql-virtual-mailbox-maps.cf which contains the following:

 user = mailuser
 password = fLxsWdf5ABLqwhZr
 hosts = 127.0.0.1
 dbname = mailserver
 query = SELECT 1 FROM virtual_users WHERE email='%s'

this is linked to in the /etc/postfix/main.cf with the following line:

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf

When I use postmap

postmap -qv [email protected] mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf

I get the following error:

fatal: open database [email protected]: No such file or directory

Clearly there is no database “[email protected]” but I’m expecting it to look in the “mailserver” database.

My answer:


Looks like you just made a typo. It should be postmap -q, not postmap -qv.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.