Postfix mysql virtual mailbox

Jump to: navigation, search
vi /etc/postfix/

Add following to end of the file

user = root
password = os2winlinmysql
hosts = localhost
dbname = bizhat_mail
table = mailbox
select_field = maildir
where_field = username
additional_conditions = and active = '1'

Set permission

chmod 700 /etc/postfix/
chown postfix:postfix /etc/postfix/


We have a user in the mailbox table when we created the database.

Let us test if mysql virtual mail box is working.

postmap -q "[email protected]" mysql:/etc/postfix/

If mysql virtual mailbox map is working, we will get

[[email protected] ~]# postmap -q "[email protected]" mysql:/etc/postfix/
[[email protected] ~]#

configure postfix for mysql based virtual host