Il 2017-09-01 22:57 Noel Jones ha scritto:
[..]
On the backup MX:
[..]
Well, finally we did it!
Basically I think we can say that the backup server does not have to
recognize as local, domains and addresses.
This is what I did:
"server1.org" the.backed-up.domain.tld (primary domain)
"server2.org" the backup MX (secondary domain)
1) never list in mydomains/myhostname the primary server domain.
2) never list in virtual_alias_domains the primary server domain. I've
commented it.
3) never list in mailbox_domains o in virtual_mailbox_domains the
primary domain. I've commented it.
4) do not list in virtual_alias_maps the primary domain. I've commented
it.
5) this is useless: smtpd_sender_login_maps. I've commented it.
6) myorigin = $myhostname
7) mydestination = server2.org, localhost.server2.org, localhost
8) always list in relay_domains every domains (virtual too)
to do so via mysql add in main.cf the following files and their
configurations:
relay_domains = mysql:/etc/postfix/mysql-relay-domains.cf
then create a file called: "/etc/postfix/mysql-relay-domains.cf" with
content:
user = user-db-postfix
password = my-password
hosts = 127.0.0.1
dbname = db-postfix-server
query = SELECT name FROM virtual_domains WHERE name='%s'
(the query content depend from the database structure)
9) then add in main.cf:
relay_recipient_maps = mysql:/etc/postfix/mysql-relay-recipient-maps.cf
create file "/etc/postfix/mysql-relay-recipient-maps.cf" with content:
user = user-db-postfix
password = my-password
hosts = 127.0.0.1
dbname = db-postfix-server
query = SELECT email FROM virtual_users WHERE email = '%s'
(the query content depend from the database structure)
10) to ensure that aliases are also accepted (is it correct?):
add in main.cf too:
relay_recipient_maps =
mysql:/etc/postfix/mysql-alias-relay-recipient-maps.cf
(relay_recipient_maps =
mysql:/etc/postfix/mysql-relay-recipient-maps.cf,mysql:/etc/postfix/mysql-alias-relay-recipient-maps.cf)
create file:
/etc/postfix/mysql-alias-relay-recipient-maps.cf
whose content must be:
user = user-db-postfix
password = my-password
hosts = 127.0.0.1
dbname = db-postfix-server
query = SELECT source FROM virtual_aliases WHERE source = '%s'
(the query content depend from the database structure)
// I hope, if this is right, this scheme may be of help to others. //
Thanks to all