Commits

Zhang Huangbin  committed a741229

Reverse last merge of transport map lookup files for mysql backend, and detect backupmx status in domain transport.

  • Participants
  • Parent commits 0f7ab1e

Comments (0)

Files changed (7)

File iRedMail/ChangeLog

           reduce our workload and bring you better support for supported
           Linux/BSD distributions.
 
-    * Merge per-domain and per-user transport_maps MySQL lookup into one file:
-      - Removed: mysql/transport_maps_domain.cf, mysql/transport_maps_user.cf
-      - New: mysql/transport_maps.cf
     * Better support for installing iRedMail with remote MySQL server.
       Reference:
       http://www.iredmail.org/wiki/index.php?title=IRedMail/FAQ/MySQL/install.iredmail.with.remote.mysql.server
       white/black/greylisting, throttling.
 
     * Fixed issues:
+        + Not detect backupmx status in domain transport map.
         + Add cron job to cleanup expired entries in Cluebringer database.
         + Add 'inet6 => 0' in Amavisd ldap settings to avoid ldap connection
           error.

File iRedMail/conf/postfix

 
 # MySQL lookup.
 export mysql_virtual_mailbox_domains_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_domains.cf"
-export mysql_transport_maps_cf="${POSTFIX_LOOKUP_DIR}/transport_maps.cf"
+export mysql_transport_maps_user_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_user.cf"
+export mysql_transport_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_domain.cf"
 export mysql_virtual_mailbox_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_maps.cf"
 export mysql_virtual_alias_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_alias_maps.cf"
 export mysql_catchall_maps_cf="${POSTFIX_LOOKUP_DIR}/catchall_maps.cf"

File iRedMail/functions/postfix.sh

 {
     ECHO_DEBUG "Configure Postfix for MySQL lookup."
 
-    postconf -e transport_maps="proxy:mysql:${mysql_transport_maps_cf}"
+    postconf -e transport_maps="proxy:mysql:${mysql_transport_maps_user_cf}, proxy:mysql:${mysql_transport_maps_domain_cf}"
     postconf -e virtual_mailbox_domains="proxy:mysql:${mysql_virtual_mailbox_domains_cf}"
     postconf -e virtual_mailbox_maps="proxy:mysql:${mysql_virtual_mailbox_maps_cf}"
     postconf -e virtual_alias_maps="proxy:mysql:${mysql_virtual_alias_maps_cf}, proxy:mysql:${mysql_domain_alias_maps_cf}, proxy:mysql:${mysql_catchall_maps_cf}, proxy:mysql:${mysql_domain_alias_catchall_maps_cf}"
     postconf -e relay_domains="\$mydestination, proxy:mysql:${mysql_relay_domains_cf}"
     postconf -e smtpd_sender_login_maps="proxy:mysql:${mysql_sender_login_maps_cf}"
 
-    cp ${SAMPLE_DIR}/postfix/mysql/transport_maps.cf ${mysql_transport_maps_cf}
+    # Per-domain and per-user transport maps.
+    cp ${SAMPLE_DIR}/postfix/mysql/transport_maps_domain.cf ${mysql_transport_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/mysql/transport_maps_user.cf ${mysql_transport_maps_user_cf}
+
     # Virtual domains
     cp ${SAMPLE_DIR}/postfix/mysql/virtual_mailbox_domains.cf ${mysql_virtual_mailbox_domains_cf}
     # Relay domains
 EOF
 
     for i in \
-        ${mysql_transport_maps_cf} \
+        ${mysql_transport_maps_domain_cf} \
+        ${mysql_transport_maps_user_cf} \
         ${mysql_virtual_mailbox_domains_cf} \
         ${mysql_relay_domains_cf} \
         ${mysql_virtual_mailbox_maps_cf} \

File iRedMail/samples/postfix/mysql/transport_maps.cf

-user        = vmail
-password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
-hosts       = 127.0.0.1
-port        = 3306
-dbname      = vmail
-query       = SELECT IF(mailbox.transport<>'', mailbox.transport, domain.transport) AS transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1

File iRedMail/samples/postfix/mysql/transport_maps_domain.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0

File iRedMail/samples/postfix/mysql/transport_maps_user.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1

File iRedMail/samples/postfix/pgsql/transport_maps_domain.cf

 hosts       = 127.0.0.1
 port        = 5432
 dbname      = vmail
-query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
+query       = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0