mysql - Postfix synchronize from primary to backup MX, domain, recipients and alias -
i've setup on debian jessie 2 postfix server (primary , backup mx) following workaround tutorial small changes.
now i'm looking best way sync "relay domains" , "relay recipients" (mysql based) primary backup mx postfix email server.
the way i've seen better (suggest me if wrong) is:
1) replicate postfix mysql database backup mx via mysql replication. however, operation must leave database of primary server intact, i.e. replication action must directed towards backup server , not vice versa!
2) tell postfix use relay domains , recipients , alias replicated database, eg like:
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf relay_recipient_maps = mysql:/etc/postfix/mysql_relay_recipients.cf transport_maps = mysql:/etc/postfix/mysql_transport.cf
/etc/postfix/mysql_relay_domains.cf :
hosts = 127.0.0.1 dbname = mailserver user = mailuser password = password query = select name virtual_domains name='%s'
/etc/postfix/mysql_relay_recipients.cf :
hosts = 127.0.0.1 dbname = mailserver user = mailuser password = password query = select email virtual_users email = '%s'
/etc/postfix/mysql_transport.cf :
hosts = 127.0.0.1 dbname = mailserver user = mailuser password = password query = select source virtual_aliases source = '%s'
in essence know if way considered sufficiently safe because not want through mysql replication risk of compromising primary postfix database. , if necessary add mysql_relay_domains.cf, mysql_relay_recipients.cf, mysql_transport.cf postfix configuration or if basic workaround setting enough.
thanks!
Comments
Post a Comment