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/ which contains the following:

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

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

virtual_mailbox_domains = mysql:/etc/postfix/

When I use postmap

postmap -qv [email protected] mysql:/etc/postfix/

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.