Create Postfix MySQL Config
We will need to create all mysql virtual files.
This will contains a config to let postfix to connect to MySQL DB
So postfix will be able to recognize the domains mapping, domain alias and mailbox mapping.
$usr/local/etc/postfix
$pico mysql_virtual_alias_maps.cf
user = postfix
password = yourpostfixpassword
hosts = localhost
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
$pico mysql_virtual_domains_maps.cf
user = postfix
password = yourpostfixpassword
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'
$pico mysql_virtual_mailbox_maps.cf
user = postfix
password = yourpostfixpassword
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'
Note :
You need to change a user , password and dbname to suit your MySQL DB info