# ============================================================ # MySQL mappings # ============================================================ relay_domains = proxy:mysql:/etc/postfix/mysql/relay_domains.cf virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/virtual_alias_domain_maps.cf virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
hosts = localhost USER = postfix password = yourpassword dbname = postfixadmin query = SELECT DOMAIN FROM DOMAIN WHERE DOMAIN='%s' AND backupmx = '1'
Проверка:
# postmap -q "example.com" mysql:/etc/postfix/mysql/relay_domains.cf
hosts = localhost USER = postfix password = yourpassword dbname = postfixadmin query = SELECT GOTO FROM alias WHERE address='%s' AND active = '1'
Проверка:
# postmap -q "abuse@example.com" mysql:/etc/postfix/mysql/virtual_alias_maps.cf
hosts = localhost USER = postfix password = yourpassword dbname = postfixadmin
hosts = localhost USER = postfix password = yourpassword dbname = postfixadmin query = SELECT DOMAIN FROM DOMAIN WHERE DOMAIN='%s' AND backupmx = '0' AND active = '1'
Проверка:
# postmap -q "example.com" mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
hosts = localhost USER = postfix password = yourpassword dbname = postfixadmin query = SELECT CONCAT(DOMAIN,'/',maildir) AS maildir FROM mailbox WHERE username='%s' AND active = '1'
Проверка:
# postmap -q "noreply@example.com" mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf