Postfix mysql virtual mailbox maps.cf

From WebHostingNeeds.com
Jump to: navigation, search
vi /etc/postfix/mysql_virtual_mailbox_maps.cf

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/mysql_virtual_mailbox_maps.cf
chown postfix:postfix /etc/postfix/mysql_virtual_mailbox_maps.cf

Testing

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/mysql_virtual_mailbox_maps.cf

If mysql virtual mailbox map is working, we will get

[root@server52 ~]# postmap -q "[email protected]" mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
info/
[root@server52 ~]#




configure postfix for mysql based virtual host

postfix