iredmail / iRedMail / conf / postfix

#!/usr/bin/env bash

# Author: Zhang Huangbin <zhb _at_ iredmail.org>

#---------------------------------------------------------------------
# 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/>.
#---------------------------------------------------------------------

# Variables for Postfix and related.

#
# You do *NOT* need to modify them.
#
# ---- Postfix ----
export POSTFIX_DAEMON_USER='postfix'
export POSTFIX_DAEMON_GROUP='postfix'

export POSTFIX_ROOTDIR='/etc/postfix'
export POSTFIX_RC_SCRIPT_NAME='postfix'

# Log file
export MAILLOG='/var/log/maillog'

# Mail log files.
if [ X"${DISTRO}" == X"SUSE" ]; then
    export MAILLOG='/var/log/mail'
    export MAILLOG_INFO='/var/log/mail.info'
    export MAILLOG_ERROR='/var/log/mail.err'
    export MAILLOG_WARN='/var/log/mail.warn'
    export POSTFIX_SYSCONFIG_CONF="${ETC_SYSCONFIG_DIR}/postfix"

elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
    export MAILLOG='/var/log/mail.log'
    export MAILLOG_INFO='/var/log/mail.info'
    export MAILLOG_ERROR='/var/log/mail.err'
    export MAILLOG_WARN='/var/log/mail.warn'

elif [ X"${DISTRO}" == X'FREEBSD' ]; then
    export POSTFIX_ROOTDIR='/usr/local/etc/postfix'

elif [ X"${DISTRO}" == X'OPENBSD' ]; then
    export POSTFIX_DAEMON_USER='_postfix'
    export POSTFIX_DAEMON_GROUP='_postfix'
fi

# You do *NOT* need to modify them.
export POSTFIX_CHROOT_DIR='/var/spool/postfix'

export POSTFIX_FILE_MAIN_CF="${POSTFIX_ROOTDIR}/main.cf"
export POSTFIX_FILE_MASTER_CF="${POSTFIX_ROOTDIR}/master.cf"
export POSTFIX_FILE_ALIASES="${POSTFIX_ROOTDIR}/aliases"
export POSTFIX_FILE_HEADER_CHECKS="${POSTFIX_ROOTDIR}/header_checks.pcre"
export POSTFIX_FILE_HELO_ACCESS="${POSTFIX_ROOTDIR}/helo_access.pcre"

# Default transport or LDA (local deliver agent).
# We use dovecot deliver program as default transport.
export TRANSPORT='dovecot'

# Set 'message_size_limit', in 'byte'. Default is 10M.
export MESSAGE_SIZE_LIMIT='15728640'

# LDAP/MYSQL/PGSQL lookup configuration files.
if [ X"${BACKEND}" == X"OPENLDAP" ]; then
    export POSTFIX_LOOKUP_DIR="${POSTFIX_ROOTDIR}/ldap"
elif [ X"${BACKEND}" == X"MYSQL" ]; then
    export POSTFIX_LOOKUP_DIR="${POSTFIX_ROOTDIR}/mysql"
elif [ X"${BACKEND}" == X"PGSQL" ]; then
    export POSTFIX_LOOKUP_DIR="${POSTFIX_ROOTDIR}/pgsql"
else
    export POSTFIX_LOOKUP_DIR="${POSTFIX_ROOTDIR}/lookups"
fi

export ldap_virtual_mailbox_domains_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_domains.cf"
export ldap_transport_maps_user_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_user.cf"
export ldap_transport_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_domain.cf"
export ldap_virtual_mailbox_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_maps.cf"
export ldap_virtual_alias_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_alias_maps.cf"
export ldap_virtual_group_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_group_maps.cf"
export ldap_virtual_maillist_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_maillist_maps.cf"
export ldap_sender_login_maps_cf="${POSTFIX_LOOKUP_DIR}/sender_login_maps.cf"
export ldap_recipient_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_domain.cf"
export ldap_recipient_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_user.cf"
export ldap_sender_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_domain.cf"
export ldap_sender_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_user.cf"
export ldap_relay_domains_cf="${POSTFIX_LOOKUP_DIR}/relay_domains.cf"
export ldap_catch_all_maps_cf="${POSTFIX_LOOKUP_DIR}/catchall_maps.cf"

# MySQL lookup.
export mysql_virtual_mailbox_domains_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_domains.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"
export mysql_domain_alias_maps_cf="${POSTFIX_LOOKUP_DIR}/domain_alias_maps.cf"
export mysql_domain_alias_catchall_maps_cf="${POSTFIX_LOOKUP_DIR}/domain_alias_catchall_maps.cf"
export mysql_sender_login_maps_cf="${POSTFIX_LOOKUP_DIR}/sender_login_maps.cf"
export mysql_sender_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_domain.cf"
export mysql_sender_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_user.cf"
export mysql_recipient_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_domain.cf"
export mysql_recipient_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_user.cf"
export mysql_relay_domains_cf="${POSTFIX_LOOKUP_DIR}/relay_domains.cf"

# PGSQL lookup.
export pgsql_virtual_mailbox_domains_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_domains.cf"
export pgsql_transport_maps_user_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_user.cf"
export pgsql_transport_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/transport_maps_domain.cf"
export pgsql_virtual_mailbox_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_mailbox_maps.cf"
export pgsql_virtual_alias_maps_cf="${POSTFIX_LOOKUP_DIR}/virtual_alias_maps.cf"
export pgsql_catchall_maps_cf="${POSTFIX_LOOKUP_DIR}/catchall_maps.cf"
export pgsql_domain_alias_maps_cf="${POSTFIX_LOOKUP_DIR}/domain_alias_maps.cf"
export pgsql_domain_alias_catchall_maps_cf="${POSTFIX_LOOKUP_DIR}/domain_alias_catchall_maps.cf"
export pgsql_sender_login_maps_cf="${POSTFIX_LOOKUP_DIR}/sender_login_maps.cf"
export pgsql_sender_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_domain.cf"
export pgsql_sender_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/sender_bcc_maps_user.cf"
export pgsql_recipient_bcc_maps_domain_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_domain.cf"
export pgsql_recipient_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR}/recipient_bcc_maps_user.cf"
export pgsql_relay_domains_cf="${POSTFIX_LOOKUP_DIR}/relay_domains.cf"
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.