Zhang Huangbin avatar Zhang Huangbin committed ce52912

Split Postfix MySQL/PGSQL lookup files as sample files: samples/postfix/{mysql,pgsql}/.

Comments (0)

Files changed (33)

iRedMail/functions/postfix.sh

     postconf -e smtpd_helo_restrictions="permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:${POSTFIX_FILE_HELO_ACCESS}"
 
     backup_file ${POSTFIX_FILE_HELO_ACCESS}
-    cp -f ${SAMPLE_DIR}/helo_access.pcre ${POSTFIX_FILE_HELO_ACCESS}
+    cp -f ${SAMPLE_DIR}/postfix/helo_access.pcre ${POSTFIX_FILE_HELO_ACCESS}
 
     # Reduce queue run delay time.
     postconf -e queue_run_delay='300s'          # default '300s' in postfix-2.4.
     postconf -e sender_bcc_maps="proxy:mysql:${mysql_sender_bcc_maps_user_cf}, proxy:mysql:${mysql_sender_bcc_maps_domain_cf}"
     postconf -e recipient_bcc_maps="proxy:mysql:${mysql_recipient_bcc_maps_user_cf}, proxy:mysql:${mysql_recipient_bcc_maps_domain_cf}"
     postconf -e relay_domains="\$mydestination, proxy:mysql:${mysql_relay_domains_cf}"
-    #postconf -e relay_recipient_maps="proxy:mysql:${mysql_virtual_mailbox_maps_cf}"
-
     postconf -e smtpd_sender_login_maps="proxy:mysql:${mysql_sender_login_maps_cf}"
 
-    # Per-domain transport maps.
-    cat > ${mysql_transport_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
-EOF
-
-    # Per-user transport maps.
-    cat > ${mysql_transport_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-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
-EOF
-
-    cat > ${mysql_virtual_mailbox_domains_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 UNION SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${mysql_relay_domains_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1
-EOF
-
-    cat > ${mysql_virtual_mailbox_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir, '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1
-EOF
-
-    cat > ${mysql_virtual_alias_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1
-EOF
-
-    cat > ${mysql_domain_alias_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${mysql_catchall_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${mysql_domain_alias_catchall_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1
-EOF
-
-    cat > ${mysql_sender_login_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
-EOF
-
-    cat > ${mysql_sender_bcc_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
-EOF
-
-    cat > ${mysql_sender_bcc_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1
-EOF
-
-    cat > ${mysql_recipient_bcc_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
-EOF
-
-    cat > ${mysql_recipient_bcc_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${MYSQL_SERVER}
-port        = ${MYSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND recipient_bcc_user.active=1
-EOF
+    # 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
+    cp ${SAMPLE_DIR}/postfix/mysql/relay_domains.cf ${mysql_relay_domains_cf}
+    # Virtual mail users
+    cp ${SAMPLE_DIR}/postfix/mysql/virtual_mailbox_maps.cf ${mysql_virtual_mailbox_maps_cf}
+    # Virtual alias
+    cp ${SAMPLE_DIR}/postfix/mysql/virtual_alias_maps.cf ${mysql_virtual_alias_maps_cf}
+    # Alias domain
+    cp ${SAMPLE_DIR}/postfix/mysql/domain_alias_maps.cf ${mysql_domain_alias_maps_cf}
+    # Catch-all
+    cp ${SAMPLE_DIR}/postfix/mysql/catchall_maps.cf ${mysql_catchall_maps_cf}
+    # Alias domain support of catch-all
+    cp ${SAMPLE_DIR}/postfix/mysql/domain_alias_catchall_maps.cf ${mysql_domain_alias_catchall_maps_cf}
+    # Sender login maps
+    cp ${SAMPLE_DIR}/postfix/mysql/sender_login_maps.cf ${mysql_sender_login_maps_cf}
+    # Sender bcc maps
+    cp ${SAMPLE_DIR}/postfix/mysql/sender_bcc_maps_domain.cf ${mysql_sender_bcc_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/mysql/sender_bcc_maps_user.cf ${mysql_sender_bcc_maps_user_cf}
+    # Recipient bcc maps
+    cp ${SAMPLE_DIR}/postfix/mysql/recipient_bcc_maps_domain.cf ${mysql_recipient_bcc_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/mysql/recipient_bcc_maps_user.cf ${mysql_recipient_bcc_maps_user_cf}
 
     ECHO_DEBUG "Set file permission: Owner/Group -> postfix/postfix, Mode -> 0640."
     cat >> ${TIP_FILE} <<EOF
 Postfix (MySQL):
     * Configuration files:
 EOF
-    for i in ${mysql_virtual_mailbox_domains_cf} \
+
+    for i in \
         ${mysql_transport_maps_domain_cf} \
         ${mysql_transport_maps_user_cf} \
+        ${mysql_virtual_mailbox_domains_cf} \
+        ${mysql_relay_domains_cf} \
         ${mysql_virtual_mailbox_maps_cf} \
         ${mysql_virtual_alias_maps_cf} \
         ${mysql_domain_alias_maps_cf} \
         ${mysql_sender_bcc_maps_domain_cf} \
         ${mysql_sender_bcc_maps_user_cf} \
         ${mysql_recipient_bcc_maps_domain_cf} \
-        ${mysql_recipient_bcc_maps_user_cf}
-    do
+        ${mysql_recipient_bcc_maps_user_cf}; do
+
+        # Set file owner and permission
         chown ${SYS_ROOT_USER}:${POSTFIX_DAEMON_GROUP} ${i}
         chmod 0640 ${i}
 
+        # Place placeholders
+        perl -pi -e 's#^(user * = ).*#${1}$ENV{VMAIL_DB_BIND_USER}#' ${i}
+        perl -pi -e 's#^(password * = ).*#${1}$ENV{VMAIL_DB_BIND_PASSWD}#' ${i}
+        perl -pi -e 's#^(hosts * = ).*#${1}$ENV{SQL_SERVER}#' ${i}
+        perl -pi -e 's#^(port * = ).*#${1}$ENV{SQL_SERVER_PORT}#' ${i}
+        perl -pi -e 's#^(dbname * = ).*#${1}$ENV{VMAIL_DB}#' ${i}
+
         cat >> ${TIP_FILE} <<EOF
         - $i
 EOF
 
     postconf -e smtpd_sender_login_maps="proxy:pgsql:${pgsql_sender_login_maps_cf}"
 
-    # Per-domain transport maps.
-    cat > ${pgsql_transport_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT transport FROM domain WHERE domain='%s' AND active=1
-EOF
-
-    # Per-user transport maps.
-    cat > ${pgsql_transport_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-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
-EOF
-
-    cat > ${pgsql_virtual_mailbox_domains_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 UNION SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${pgsql_relay_domains_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1
-EOF
-
-    cat > ${pgsql_virtual_mailbox_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT (mailbox.storagenode || '/' || mailbox.maildir || '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1
-EOF
-
-    cat > ${pgsql_virtual_alias_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1
-EOF
-
-    cat > ${pgsql_domain_alias_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=('%u' || '@' || alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${pgsql_catchall_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0
-EOF
-
-    cat > ${pgsql_domain_alias_catchall_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1
-EOF
-
-    cat > ${pgsql_sender_login_maps_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
-EOF
-
-    cat > ${pgsql_sender_bcc_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
-EOF
-
-    cat > ${pgsql_sender_bcc_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1
-EOF
-
-    cat > ${pgsql_recipient_bcc_maps_domain_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
-EOF
-
-    cat > ${pgsql_recipient_bcc_maps_user_cf} <<EOF
-${CONF_MSG}
-user        = ${VMAIL_DB_BIND_USER}
-password    = ${VMAIL_DB_BIND_PASSWD}
-hosts       = ${PGSQL_SERVER}
-port        = ${PGSQL_SERVER_PORT}
-dbname      = ${VMAIL_DB}
-query       = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND recipient_bcc_user.active=1
-EOF
+    # Per-domain and per-user transport maps.
+    cp ${SAMPLE_DIR}/postfix/pgsql/transport_maps_domain.cf ${pgsql_transport_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/pgsql/transport_maps_user.cf ${pgsql_transport_maps_user_cf}
+    # Virtual domains
+    cp ${SAMPLE_DIR}/postfix/pgsql/virtual_mailbox_domains.cf ${pgsql_virtual_mailbox_domains_cf}
+    # Relay domains
+    cp ${SAMPLE_DIR}/postfix/pgsql/relay_domains.cf ${pgsql_relay_domains_cf}
+    # Virtual mailboxes
+    cp ${SAMPLE_DIR}/postfix/pgsql/virtual_mailbox_maps.cf ${pgsql_virtual_mailbox_maps_cf}
+    # Virtual aliases
+    cp ${SAMPLE_DIR}/postfix/pgsql/virtual_alias_maps.cf ${pgsql_virtual_alias_maps_cf}
+    # Alias domains
+    cp ${SAMPLE_DIR}/postfix/pgsql/domain_alias_maps.cf ${pgsql_domain_alias_maps_cf}
+    # Catch-all
+    cp ${SAMPLE_DIR}/postfix/pgsql/catchall_maps.cf ${pgsql_catchall_maps_cf}
+    # Alias domain support of catch-all
+    cp ${SAMPLE_DIR}/postfix/pgsql/domain_alias_catchall_maps.cf ${pgsql_domain_alias_catchall_maps_cf}
+    # Sender login maps
+    cp ${SAMPLE_DIR}/postfix/pgsql/sender_login_maps.cf ${pgsql_sender_login_maps_cf}
+    # Per-domain and per-user sender bcc maps
+    cp ${SAMPLE_DIR}/postfix/pgsql/sender_bcc_maps_domain.cf ${pgsql_sender_bcc_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/pgsql/sender_bcc_maps_user.cf ${pgsql_sender_bcc_maps_user_cf}
+    # Per-domain and per-user recipient bcc maps
+    cp ${SAMPLE_DIR}/postfix/pgsql/recipient_bcc_maps_domain.cf ${pgsql_recipient_bcc_maps_domain_cf}
+    cp ${SAMPLE_DIR}/postfix/pgsql/recipient_bcc_maps_user.cf ${pgsql_recipient_bcc_maps_user_cf}
 
     ECHO_DEBUG "Set file permission: Owner/Group -> postfix/postfix, Mode -> 0640."
     cat >> ${TIP_FILE} <<EOF
 Postfix (PostgreSQL):
     * Configuration files:
 EOF
-    for i in ${pgsql_virtual_mailbox_domains_cf} \
+
+    for i in \
         ${pgsql_transport_maps_domain_cf} \
         ${pgsql_transport_maps_user_cf} \
+        ${pgsql_virtual_mailbox_domains_cf} \
+        ${pgsql_relay_domains_cf} \
         ${pgsql_virtual_mailbox_maps_cf} \
         ${pgsql_virtual_alias_maps_cf} \
         ${pgsql_domain_alias_maps_cf} \
         ${pgsql_sender_bcc_maps_domain_cf} \
         ${pgsql_sender_bcc_maps_user_cf} \
         ${pgsql_recipient_bcc_maps_domain_cf} \
-        ${pgsql_recipient_bcc_maps_user_cf}
-    do
+        ${pgsql_recipient_bcc_maps_user_cf}; do
+
+        # Set file owner and permission
         chown ${SYS_ROOT_USER}:${POSTFIX_DAEMON_GROUP} ${i}
         chmod 0640 ${i}
 
+        # Place placeholders
+        perl -pi -e 's#^(user * = ).*#${1}$ENV{VMAIL_DB_BIND_USER}#' ${i}
+        perl -pi -e 's#^(password * = ).*#${1}$ENV{VMAIL_DB_BIND_PASSWD}#' ${i}
+        perl -pi -e 's#^(hosts * = ).*#${1}$ENV{SQL_SERVER}#' ${i}
+        perl -pi -e 's#^(port * = ).*#${1}$ENV{SQL_SERVER_PORT}#' ${i}
+        perl -pi -e 's#^(dbname * = ).*#${1}$ENV{VMAIL_DB}#' ${i}
+
         cat >> ${TIP_FILE} <<EOF
         - $i
 EOF

iRedMail/samples/helo_access.pcre

-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-#
-# Sample Postfix check_helo_access rule. It should be localted at:
-#   /etc/postfix/check_helo_access.pcre
-#
-# Shipped within iRedMail project:
-#   * http://www.iredmail.org/
-#
-# Thanks all contributer(s):
-#   * muniao <at> gamil.
-#
-
-# Prepend HELO hostname of sender server
-#/(.*)/ PREPEND X-Original-Helo: $1 (iRedMail: http://www.iredmail.org/)
-
-#*******************************************
-# IP address: (([0-9]){3}-){2}
-#*******************************************
-
-# No one will use these in helo command.
-/^localhost$/               REJECT Go away, bad guy (localhost).
-/^localhost.localdomain$/   REJECT Go away, bad guy (localhost.localdomain).
-
-# Reject who use IP address as helo.
-# Correct:      [xxx.xxx.xxx.xxx]
-# Incorrect:    xxx.xxx.xxx.xxx
-/^[0-9.]+$/     REJECT Go away, bad guy (not RFC compliant).
-
-#
-# This is the real HELO identify of these ISPs:
-#   sohu.com    websmtp.sohu.com relay2nd.mail.sohu.com
-#   126.com     m15-78.126.com
-#   163.com     m31-189.vip.163.com m13-49.163.com
-#   sina.com    mail2-209.sinamail.sina.com.cn
-#   gmail.com   xx-out-NNNN.google.com
-#
-/^126\.com$/        REJECT Go away, bad guy (126.com).
-/^163\.com$/        REJECT Go away, bad guy (163.com).
-/^163\.net$/        REJECT Go away, bad guy (163.net).
-/^sohu\.com$/       REJECT Go away, bad guy (sohu.com).
-/gmail\.com$/       REJECT Go away, bad guy (gmail.com).
-/^google\.com$/     REJECT Go away, bad guy (google.com).
-/^yahoo\.com\.cn$/  REJECT Go away, bad guy (yahoo.com.cn).
-/^yahoo\.co\.jp$/   REJECT Go away, bad guy (yahoo.co.jp).
-
-#
-# Spammers.
-#
-/^728154EA470B4AA\.com$/        REJECT Go away, bad guy (728154EA470B4AA.com).
-/^dsldevice\.lan$/              REJECT Go away, bad guy (dsldevice.lan).
-/^taj-co\.com$/                 REJECT Go away, bad guy (taj-co.com).
-/^CF8D3DB045C1455\.net$/        REJECT Go away, bad guy (CF8D3DB045C1455.net).
-/^dsgsfdg\.com$/                REJECT Go away, bad guy (dsgsfdg.com).
-/^se\.nit7-ngbo\.com$/          REJECT Go away, bad guy (se.nit7-ngbo.com).
-/^mail\.goo\.ne\.jp$/           REJECT Go away, bad guy (mail.goo.ne.jp).
-/^n-ong_an\.com$/               REJECT Go away, bad guy (n-ong_an.com).
-/^e5\.il\.n5tt\.zj\.cn$/        REJECT Go away, bad guy (e5.il.n5tt.zj.cn).
-/^meqail\.teamefs-ine5tl\.com$/ REJECT Go away, bad guy (meqail.teamefs-ine5tl.com).
-/^zzg\.jhf-sp\.com$/            REJECT Go away, bad guy (zzg.jhf-sp.com).
-/^din_glo-ng\.net$/             REJECT Go away, bad guy (din_glo-ng.net).
-/^fda-cnc\.ie\.com$/            REJECT Go away, bad guy (fda-cnc.ie.com).
-/^yrtaj-yrco\.com$/             REJECT Go away, bad guy (yrtaj-yrco.com).
-/^m\.am\.biz\.cn$/              REJECT Go away, bad guy (m.am.biz.cn).
-/^xr_haig\.roup\.com$/          REJECT Go away, bad guy (xr_haig.roup.com).
-/^hjn\.cn$/                     REJECT Go away, bad guy (hjn.cn).
-/^we_blf\.com\.cn$/             REJECT Go away, bad guy (we_blf.com.cn).
-/^netvigator\.com$/             REJECT Go away, bad guy (netvigator.com).
-/^mysam\.biz$/                  REJECT Go away, bad guy (mysam.biz).
-/^mail\.teams-intl\.com$/       REJECT Go away, bad guy (mail.teams-intl.com).
-/^seningbo\.com$/               REJECT Go away, bad guy (seningbo.com).
-/^nblf\.com\.cn$/               REJECT Go away, bad guy (nblf.com.cn).
-/^kdn\.ktguide\.com$/           REJECT Go away, bad guy (kdn.ktguide.com).
-/^zzsp\.com$/                   REJECT Go away, bad guy (zzsp.com).
-/^nblongan\.com$/               REJECT Go away, bad guy (nblongan.com).
-/^dpu\.cn$/                     REJECT Go away, bad guy (dpu.cn).
-/^mail\.nbptt\.zj\.cn$/         REJECT Go away, bad guy (mail.nbptt.zj.cn).
-/^nbalton\.com$/                REJECT Go away, bad guy (nbalton.com).
-/^cncie\.com$/                  REJECT Go away, bad guy (cncie.com).
-/^xinhaigroup\.com$/            REJECT Go away, bad guy (xinhaigroup.com).
-/^system.mail$/             REJECT Go away, bad guy (system.mail).
-/^wz\.com$/                 REJECT Go away, bad guy (wz.com).
-/^speedtouch\.lan$/         REJECT Go away, bad guy (speedtouch.lan).
-/^dsldevice\.lan$/          REJECT Go away, bad guy (dsldevice.lan).
-/\.zj.cn$/                  REJECT Go away, bad guy (.zj.cn).
-/\.kornet$/                 REJECT Go away, bad guy (.kornet).
-/\.zj.cn$/                  REJECT Go away, bad guy (.zj.cn).
-/\.local$/                  REJECT Go away, bad guy (.local).
-
-#
-# Reject adsl spammers.
-#
-/adsl/                      REJECT Go away, bad guy (adsl).
-/dynamic/                   REJECT Go away, bad guy (dynamic)
-/\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}/   REJECT Go away (dynamic).
-/pppoe/                     REJECT Go away, bad guy (pppoe).
-/dsl\.brasiltelecom\.net\.br/   REJECT Go away, bad guy (dsl.optinet.hr)
-/dsl\.optinet\.hr/          REJECT Go away, bad guy (dsl.telesp.net.br)
-/dsl\.telesp\.net\.br/      REJECT Go away, bad guy (dialog)
-/dialup/                    REJECT Go away, bad guy (dialup)
-/dhcp/                      REJECT Go away, bad guy (dhcp)
-/dhcp\.stls\.mo\.charter\.com/  REJECT Go away, bad guy (dhcp.stls.mo.charter.com)
-/pool-/                     REJECT Go away, bad guy (pool-)
-/^cpe-/                     REJECT Go away, bad guy (cpe-)
-/\.cpe\./                   REJECT Go away, bad guy (.cpe.)
-
-/speedy\.com\.ar$/          REJECT Go away, bad guy (speedy.com.ar)
-/speedyterra\.com\.br$/     REJECT Go away, bad guy (speedyterra.com.br)
-/static\.sbb\.rs$/          REJECT Go away, bad guy (static.sbb.rs)
-/static\.vsnl\.net\.in$/    REJECT Go away, bad guy (static.vsnl.net.in)
-
-/advance\.com\.ar/          REJECT Go away, bad guy
-/airtelbroadband\.in/       REJECT Go away, bad guy
-/bb\.netvision\.net\.il/    REJECT Go away, bad guy
-/bezeqint\.net/             REJECT Go away, bad guy
-/broadband3\.iol\.cz/       REJECT Go away, bad guy
-/cable\.net\.co/            REJECT Go away, bad guy
-/catv\.broadband\.hu/       REJECT Go away, bad guy
-/chello\.nl/                REJECT Go away, bad guy
-/chello\.sk/                REJECT Go away, bad guy
-/client\.mchsi\.com/        REJECT Go away, bad guy
-/cncdnh\.east\.verizon\.net/    REJECT Go away, bad guy
-/comunitel\.net/            REJECT Go away, bad guy
-/coprosys\.cz/              REJECT Go away, bad guy
-/dclient\.hispeed\.ch/      REJECT Go away, bad guy
-/dfw\.dsl-w\.verizon\.net/  REJECT Go away, bad guy
-/dip0\.t-ipconnect\.de/     REJECT Go away, bad guy
-/domain\.invalid/           REJECT Go away, bad guy
-/dyn\.centurytel\.net/      REJECT Go away, bad guy
-/embarqhsd\.net/            REJECT Go away, bad guy
-/emcali\.net\.co/           REJECT Go away, bad guy
-/epm\.net\.co/              REJECT Go away, bad guy
-/eutelia\.it/               REJECT Go away, bad guy
-/fastwebnet\.it/            REJECT Go away, bad guy
-/fibertel\.com\.ar/         REJECT Go away, bad guy
-/freedom2surf\.net$/        REJECT Go away, bad guy
-/hgcbroadband\.com$/        REJECT Go away, bad guy
-/HINET-IP\.hinet\.net$/     REJECT Go away, bad guy
-/infonet\.by$/              REJECT Go away, bad guy
-/is74\.ru$/                 REJECT Go away, bad guy
-/kievnet\.com\.ua$/         REJECT Go away, bad guy
-/metrotel\.net\.co$/        REJECT Go away, bad guy
-/nw\.nuvox\.net$/           REJECT Go away, bad guy
-/pitbpa\.fios\.verizon\.net$/   REJECT Go away, bad guy
-/pldt\.net$/                REJECT Go away, bad guy
-/pool\.invitel\.hu$/        REJECT Go away, bad guy
-/pool\.ukrtel\.net$/        REJECT Go away, bad guy
-/pools\.arcor-ip\.net$/     REJECT Go away, bad guy
-/pppoe\.avangarddsl\.ru$/   REJECT Go away, bad guy
-/retail\.telecomitalia\.it$/    REJECT Go away, bad guy
-/revip2\.asianet\.co\.th$/  REJECT Go away, bad guy
-/tim\.ro$/                  REJECT Go away, bad guy
-/tsi\.tychy\.pl/            REJECT Go away, bad guy
-/ttnet\.net\.tr/            REJECT Go away, bad guy
-/tttmaxnet\.com/            REJECT Go away, bad guy
-/user\.veloxzone\.com\.br/  REJECT Go away, bad guy
-/utk\.ru$/                  REJECT Go away, bad guy
-/veloxzone\.com\.br$/       REJECT Go away, bad guy
-/verizon\.net$/             REJECT Go away, bad guy
-/virtua\.com\.br$/          REJECT Go away, bad guy
-/wanamaroc\.com$/           REJECT Go away, bad guy
-/wbt\.ru$/                  REJECT Go away, bad guy
-/wireless\.iaw\.on\.ca$/    REJECT Go away, bad guy
-/zj\.cn$/                   REJECT Go away, bad guy
-/business\.telecomitalia\.it$/  REJECT Go away, bad guy
-/cotas\.com\.bo$/           REJECT Go away, bad guy
-/marunouchi\.tokyo\.ocn\.ne\.jp$/   REJECT Go away, bad guy
-/amedex\.com$/              REJECT Go away, bad guy.
-/aageneva\.com$/            REJECT Go away, bad guy.

iRedMail/samples/iredmail.mysql

     employeeid VARCHAR(255) DEFAULT '',
     isadmin TINYINT(1) NOT NULL DEFAULT 0,
     isglobaladmin TINYINT(1) NOT NULL DEFAULT 0,
-    language VARCHAR(5) NOT NULL DEFAULT 'en_US',
     enablesmtp TINYINT(1) NOT NULL DEFAULT 1,
     enablesmtpsecured TINYINT(1) NOT NULL DEFAULT 1,
     enablepop3 TINYINT(1) NOT NULL DEFAULT 1,
     INDEX (department),
     INDEX (employeeid),
     INDEX (isadmin),
+    INDEX (isglobaladmin),
     INDEX (enablesmtp),
     INDEX (enablesmtpsecured),
     INDEX (enablepop3),

iRedMail/samples/iredmail.pgsql

     employeeid VARCHAR(255) DEFAULT '',
     isadmin INT2 NOT NULL DEFAULT 0,
     isglobaladmin INT2 NOT NULL DEFAULT 0,
-    language VARCHAR(5) NOT NULL DEFAULT 'en_US',
     enablesmtp INT2 NOT NULL DEFAULT 1,
     enablesmtpsecured INT2 NOT NULL DEFAULT 1,
     enablepop3 INT2 NOT NULL DEFAULT 1,
 CREATE INDEX idx_mailbox_department ON mailbox (department);
 CREATE INDEX idx_mailbox_employeeid ON mailbox (employeeid);
 CREATE INDEX idx_mailbox_isadmin ON mailbox (isadmin);
+CREATE INDEX idx_mailbox_isglobaladmin ON mailbox (isglobaladmin);
 CREATE INDEX idx_mailbox_enablesmtp ON mailbox (enablesmtp);
 CREATE INDEX idx_mailbox_enablesmtpsecured ON mailbox (enablesmtpsecured);
 CREATE INDEX idx_mailbox_enablepop3 ON mailbox (enablepop3);

iRedMail/samples/postfix/helo_access.pcre

+#---------------------------------------------------------------------
+# This file is part of iRedMail, which is an open source mail server
+# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
+#
+# iRedMail is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# iRedMail is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
+#---------------------------------------------------------------------
+
+#
+# Sample Postfix check_helo_access rule. It should be localted at:
+#   /etc/postfix/check_helo_access.pcre
+#
+# Shipped within iRedMail project:
+#   * http://www.iredmail.org/
+#
+# Thanks all contributer(s):
+#   * muniao <at> gamil.
+#
+
+# Prepend HELO hostname of sender server
+#/(.*)/ PREPEND X-Original-Helo: $1 (iRedMail: http://www.iredmail.org/)
+
+#*******************************************
+# IP address: (([0-9]){3}-){2}
+#*******************************************
+
+# No one will use these in helo command.
+/^localhost$/               REJECT Go away, bad guy (localhost).
+/^localhost.localdomain$/   REJECT Go away, bad guy (localhost.localdomain).
+
+# Reject who use IP address as helo.
+# Correct:      [xxx.xxx.xxx.xxx]
+# Incorrect:    xxx.xxx.xxx.xxx
+/^[0-9.]+$/     REJECT Go away, bad guy (not RFC compliant).
+
+#
+# This is the real HELO identify of these ISPs:
+#   sohu.com    websmtp.sohu.com relay2nd.mail.sohu.com
+#   126.com     m15-78.126.com
+#   163.com     m31-189.vip.163.com m13-49.163.com
+#   sina.com    mail2-209.sinamail.sina.com.cn
+#   gmail.com   xx-out-NNNN.google.com
+#
+/^126\.com$/        REJECT Go away, bad guy (126.com).
+/^163\.com$/        REJECT Go away, bad guy (163.com).
+/^163\.net$/        REJECT Go away, bad guy (163.net).
+/^sohu\.com$/       REJECT Go away, bad guy (sohu.com).
+/gmail\.com$/       REJECT Go away, bad guy (gmail.com).
+/^google\.com$/     REJECT Go away, bad guy (google.com).
+/^yahoo\.com\.cn$/  REJECT Go away, bad guy (yahoo.com.cn).
+/^yahoo\.co\.jp$/   REJECT Go away, bad guy (yahoo.co.jp).
+
+#
+# Spammers.
+#
+/^728154EA470B4AA\.com$/        REJECT Go away, bad guy (728154EA470B4AA.com).
+/^dsldevice\.lan$/              REJECT Go away, bad guy (dsldevice.lan).
+/^taj-co\.com$/                 REJECT Go away, bad guy (taj-co.com).
+/^CF8D3DB045C1455\.net$/        REJECT Go away, bad guy (CF8D3DB045C1455.net).
+/^dsgsfdg\.com$/                REJECT Go away, bad guy (dsgsfdg.com).
+/^se\.nit7-ngbo\.com$/          REJECT Go away, bad guy (se.nit7-ngbo.com).
+/^mail\.goo\.ne\.jp$/           REJECT Go away, bad guy (mail.goo.ne.jp).
+/^n-ong_an\.com$/               REJECT Go away, bad guy (n-ong_an.com).
+/^e5\.il\.n5tt\.zj\.cn$/        REJECT Go away, bad guy (e5.il.n5tt.zj.cn).
+/^meqail\.teamefs-ine5tl\.com$/ REJECT Go away, bad guy (meqail.teamefs-ine5tl.com).
+/^zzg\.jhf-sp\.com$/            REJECT Go away, bad guy (zzg.jhf-sp.com).
+/^din_glo-ng\.net$/             REJECT Go away, bad guy (din_glo-ng.net).
+/^fda-cnc\.ie\.com$/            REJECT Go away, bad guy (fda-cnc.ie.com).
+/^yrtaj-yrco\.com$/             REJECT Go away, bad guy (yrtaj-yrco.com).
+/^m\.am\.biz\.cn$/              REJECT Go away, bad guy (m.am.biz.cn).
+/^xr_haig\.roup\.com$/          REJECT Go away, bad guy (xr_haig.roup.com).
+/^hjn\.cn$/                     REJECT Go away, bad guy (hjn.cn).
+/^we_blf\.com\.cn$/             REJECT Go away, bad guy (we_blf.com.cn).
+/^netvigator\.com$/             REJECT Go away, bad guy (netvigator.com).
+/^mysam\.biz$/                  REJECT Go away, bad guy (mysam.biz).
+/^mail\.teams-intl\.com$/       REJECT Go away, bad guy (mail.teams-intl.com).
+/^seningbo\.com$/               REJECT Go away, bad guy (seningbo.com).
+/^nblf\.com\.cn$/               REJECT Go away, bad guy (nblf.com.cn).
+/^kdn\.ktguide\.com$/           REJECT Go away, bad guy (kdn.ktguide.com).
+/^zzsp\.com$/                   REJECT Go away, bad guy (zzsp.com).
+/^nblongan\.com$/               REJECT Go away, bad guy (nblongan.com).
+/^dpu\.cn$/                     REJECT Go away, bad guy (dpu.cn).
+/^mail\.nbptt\.zj\.cn$/         REJECT Go away, bad guy (mail.nbptt.zj.cn).
+/^nbalton\.com$/                REJECT Go away, bad guy (nbalton.com).
+/^cncie\.com$/                  REJECT Go away, bad guy (cncie.com).
+/^xinhaigroup\.com$/            REJECT Go away, bad guy (xinhaigroup.com).
+/^system.mail$/             REJECT Go away, bad guy (system.mail).
+/^wz\.com$/                 REJECT Go away, bad guy (wz.com).
+/^speedtouch\.lan$/         REJECT Go away, bad guy (speedtouch.lan).
+/^dsldevice\.lan$/          REJECT Go away, bad guy (dsldevice.lan).
+/\.zj.cn$/                  REJECT Go away, bad guy (.zj.cn).
+/\.kornet$/                 REJECT Go away, bad guy (.kornet).
+/\.zj.cn$/                  REJECT Go away, bad guy (.zj.cn).
+/\.local$/                  REJECT Go away, bad guy (.local).
+
+#
+# Reject adsl spammers.
+#
+/adsl/                      REJECT Go away, bad guy (adsl).
+/dynamic/                   REJECT Go away, bad guy (dynamic)
+/\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}/   REJECT Go away (dynamic).
+/pppoe/                     REJECT Go away, bad guy (pppoe).
+/dsl\.brasiltelecom\.net\.br/   REJECT Go away, bad guy (dsl.optinet.hr)
+/dsl\.optinet\.hr/          REJECT Go away, bad guy (dsl.telesp.net.br)
+/dsl\.telesp\.net\.br/      REJECT Go away, bad guy (dialog)
+/dialup/                    REJECT Go away, bad guy (dialup)
+/dhcp/                      REJECT Go away, bad guy (dhcp)
+/dhcp\.stls\.mo\.charter\.com/  REJECT Go away, bad guy (dhcp.stls.mo.charter.com)
+/pool-/                     REJECT Go away, bad guy (pool-)
+/^cpe-/                     REJECT Go away, bad guy (cpe-)
+/\.cpe\./                   REJECT Go away, bad guy (.cpe.)
+
+/speedy\.com\.ar$/          REJECT Go away, bad guy (speedy.com.ar)
+/speedyterra\.com\.br$/     REJECT Go away, bad guy (speedyterra.com.br)
+/static\.sbb\.rs$/          REJECT Go away, bad guy (static.sbb.rs)
+/static\.vsnl\.net\.in$/    REJECT Go away, bad guy (static.vsnl.net.in)
+
+/advance\.com\.ar/          REJECT Go away, bad guy
+/airtelbroadband\.in/       REJECT Go away, bad guy
+/bb\.netvision\.net\.il/    REJECT Go away, bad guy
+/bezeqint\.net/             REJECT Go away, bad guy
+/broadband3\.iol\.cz/       REJECT Go away, bad guy
+/cable\.net\.co/            REJECT Go away, bad guy
+/catv\.broadband\.hu/       REJECT Go away, bad guy
+/chello\.nl/                REJECT Go away, bad guy
+/chello\.sk/                REJECT Go away, bad guy
+/client\.mchsi\.com/        REJECT Go away, bad guy
+/cncdnh\.east\.verizon\.net/    REJECT Go away, bad guy
+/comunitel\.net/            REJECT Go away, bad guy
+/coprosys\.cz/              REJECT Go away, bad guy
+/dclient\.hispeed\.ch/      REJECT Go away, bad guy
+/dfw\.dsl-w\.verizon\.net/  REJECT Go away, bad guy
+/dip0\.t-ipconnect\.de/     REJECT Go away, bad guy
+/domain\.invalid/           REJECT Go away, bad guy
+/dyn\.centurytel\.net/      REJECT Go away, bad guy
+/embarqhsd\.net/            REJECT Go away, bad guy
+/emcali\.net\.co/           REJECT Go away, bad guy
+/epm\.net\.co/              REJECT Go away, bad guy
+/eutelia\.it/               REJECT Go away, bad guy
+/fastwebnet\.it/            REJECT Go away, bad guy
+/fibertel\.com\.ar/         REJECT Go away, bad guy
+/freedom2surf\.net$/        REJECT Go away, bad guy
+/hgcbroadband\.com$/        REJECT Go away, bad guy
+/HINET-IP\.hinet\.net$/     REJECT Go away, bad guy
+/infonet\.by$/              REJECT Go away, bad guy
+/is74\.ru$/                 REJECT Go away, bad guy
+/kievnet\.com\.ua$/         REJECT Go away, bad guy
+/metrotel\.net\.co$/        REJECT Go away, bad guy
+/nw\.nuvox\.net$/           REJECT Go away, bad guy
+/pitbpa\.fios\.verizon\.net$/   REJECT Go away, bad guy
+/pldt\.net$/                REJECT Go away, bad guy
+/pool\.invitel\.hu$/        REJECT Go away, bad guy
+/pool\.ukrtel\.net$/        REJECT Go away, bad guy
+/pools\.arcor-ip\.net$/     REJECT Go away, bad guy
+/pppoe\.avangarddsl\.ru$/   REJECT Go away, bad guy
+/retail\.telecomitalia\.it$/    REJECT Go away, bad guy
+/revip2\.asianet\.co\.th$/  REJECT Go away, bad guy
+/tim\.ro$/                  REJECT Go away, bad guy
+/tsi\.tychy\.pl/            REJECT Go away, bad guy
+/ttnet\.net\.tr/            REJECT Go away, bad guy
+/tttmaxnet\.com/            REJECT Go away, bad guy
+/user\.veloxzone\.com\.br/  REJECT Go away, bad guy
+/utk\.ru$/                  REJECT Go away, bad guy
+/veloxzone\.com\.br$/       REJECT Go away, bad guy
+/verizon\.net$/             REJECT Go away, bad guy
+/virtua\.com\.br$/          REJECT Go away, bad guy
+/wanamaroc\.com$/           REJECT Go away, bad guy
+/wbt\.ru$/                  REJECT Go away, bad guy
+/wireless\.iaw\.on\.ca$/    REJECT Go away, bad guy
+/zj\.cn$/                   REJECT Go away, bad guy
+/business\.telecomitalia\.it$/  REJECT Go away, bad guy
+/cotas\.com\.bo$/           REJECT Go away, bad guy
+/marunouchi\.tokyo\.ocn\.ne\.jp$/   REJECT Go away, bad guy
+/amedex\.com$/              REJECT Go away, bad guy.
+/aageneva\.com$/            REJECT Go away, bad guy.

iRedMail/samples/postfix/mysql/catchall_maps.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0

iRedMail/samples/postfix/mysql/domain_alias_catchall_maps.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1

iRedMail/samples/postfix/mysql/domain_alias_maps.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0

iRedMail/samples/postfix/mysql/recipient_bcc_maps_domain.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1

iRedMail/samples/postfix/mysql/recipient_bcc_maps_user.cf

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

iRedMail/samples/postfix/mysql/relay_domains.cf

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

iRedMail/samples/postfix/mysql/sender_bcc_maps_domain.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1

iRedMail/samples/postfix/mysql/sender_bcc_maps_user.cf

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

iRedMail/samples/postfix/mysql/sender_login_maps.cf

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

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

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

iRedMail/samples/postfix/mysql/virtual_alias_maps.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1

iRedMail/samples/postfix/mysql/virtual_mailbox_domains.cf

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

iRedMail/samples/postfix/mysql/virtual_mailbox_maps.cf

+user        = vmail
+password    = NSep2RRC7vzN9k6dW5bnc07fTLDEW7
+hosts       = 127.0.0.1
+port        = 3306
+dbname      = vmail
+query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir, '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1

iRedMail/samples/postfix/pgsql/catchall_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0

iRedMail/samples/postfix/pgsql/domain_alias_catchall_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1

iRedMail/samples/postfix/pgsql/domain_alias_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=('%u' || '@' || alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0

iRedMail/samples/postfix/pgsql/recipient_bcc_maps_domain.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1

iRedMail/samples/postfix/pgsql/recipient_bcc_maps_user.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND recipient_bcc_user.active=1

iRedMail/samples/postfix/pgsql/relay_domains.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1

iRedMail/samples/postfix/pgsql/sender_bcc_maps_domain.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1

iRedMail/samples/postfix/pgsql/sender_bcc_maps_user.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1

iRedMail/samples/postfix/pgsql/sender_login_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1

iRedMail/samples/postfix/pgsql/transport_maps_domain.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT transport FROM domain WHERE domain='%s' AND active=1

iRedMail/samples/postfix/pgsql/transport_maps_user.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+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

iRedMail/samples/postfix/pgsql/virtual_alias_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1

iRedMail/samples/postfix/pgsql/virtual_mailbox_domains.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 UNION SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0

iRedMail/samples/postfix/pgsql/virtual_mailbox_maps.cf

+user        = vmail
+password    = yCrSkh8YsoGn6GNKSVCVomi6ecb4Pi
+hosts       = 127.0.0.1
+port        = 5432
+dbname      = vmail
+query       = SELECT (mailbox.storagenode || '/' || mailbox.maildir || '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.