iredmail / iRedMail / conf / amavisd

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

# Warning: Please source 'conf/postfix' first.

export AMAVISD_SYS_USER='amavis'
export AMAVISD_SYS_GROUP='amavis'
export AMAVISD_QUARANTINE_PORT='9998'
export AMAVISD_LOGFILE='/var/log/amavisd.log'
export AMAVISD_LOGROTATE_FILE="${LOGROTATE_DIR}/amavisd"
export AMAVISD_DKIM_SELECTOR='dkim'
export AMAVISD_DKIM_DIR='/var/lib/dkim'

# Database used to store incoming & outgoing email related information.
export AMAVISD_DB_NAME='amavisd'
export AMAVISD_DB_USER='amavisd'
export AMAVISD_DB_PASSWD="$(${RANDOM_STRING})"
export AMAVISD_DB_MYSQL_TMPL="${SAMPLE_DIR}/amavisd.mysql"
export AMAVISD_DB_PGSQL_TMPL="${SAMPLE_DIR}/amavisd.pgsql"
export MYSQL_BACKUP_DATABASES="${MYSQL_BACKUP_DATABASES} ${AMAVISD_DB_NAME}"

# Altermime.
export ALTERMIME_BIN='/usr/bin/altermime'
export DISCLAIMER_DIR="${POSTFIX_ROOTDIR}/disclaimer"

if [ X"${DISTRO}" == X"RHEL" ]; then
    export AMAVISD_BIN='/usr/sbin/amavisd'
    export AMAVISD_RC_SCRIPT_NAME='amavisd'
    export AMAVISD_LDAP_SCHEMA_NAME='amavisd-new.schema'

    if [ X"${DISTRO_VERSION}" == X"5" ]; then
        export AMAVISD_CONF='/etc/amavisd.conf'
        export AMAVISD_VIRUSMAILS_DIR='/var/virusmails'
    elif [ X"${DISTRO_VERSION}" == X"6" ]; then
        export AMAVISD_CONF='/etc/amavisd/amavisd.conf'
    fi

    export AMAVISD_DKIM_CONF="${AMAVISD_CONF}"
    export AMAVISD_MYHOME='/var/spool/amavisd'
    export AMAVISD_QUARANTINEDIR="${AMAVISD_MYHOME}/quarantine"
    export AMAVISD_TEMPDIR="${AMAVISD_MYHOME}/tmp"

elif [ X"${DISTRO}" == X"SUSE" ]; then
    # Override global setting: user/group.
    export AMAVISD_SYS_USER='vscan'
    export AMAVISD_SYS_GROUP='vscan'
    export AMAVISD_DKIM_DIR='/var/spool/amavis/dkim'

    export AMAVISD_BIN='/usr/sbin/amavisd'
    export AMAVISD_CONF='/etc/amavisd.conf'
    export AMAVISD_DKIM_CONF='/etc/amavisd.conf'
    export AMAVISD_RC_SCRIPT_NAME='amavis'
    export AMAVISD_LDAP_SCHEMA_NAME='amavisd-new.schema'
    export AMAVISD_VIRUSMAILS_DIR='/var/spool/amavis/virusmails'

    # Override default Amavisd MySQL template file
    # openSUSE-12.1 ships Amavisd-new-2.7.0
    if [ X"${DISTRO_VERSION}" != X"11.3" -a X"${DISTRO_VERSION}" != X"11.4" ]; then
        export AMAVISD_DB_MYSQL_TMPL="${SAMPLE_DIR}/amavisd-2.7.0.mysql"
    fi

elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
    export AMAVISD_BIN='/usr/sbin/amavisd-new'
    export AMAVISD_CONF_DIR='/etc/amavis/conf.d'
    export AMAVISD_CONF='/etc/amavis/conf.d/50-user'
    export AMAVISD_DKIM_CONF='/etc/amavis/conf.d/50-user'
    export AMAVISD_RC_SCRIPT_NAME='amavis'
    export AMAVISD_LDAP_SCHEMA_NAME='amavis.schema'
    export AMAVISD_VIRUSMAILS_DIR='/var/lib/amavis/virusmails'

elif [ X"${DISTRO}" == X"GENTOO" ]; then
    export AMAVISD_BIN='/usr/sbin/amavisd'
    export AMAVISD_RC_SCRIPT_NAME='amavisd'
    export AMAVISD_LDAP_SCHEMA_NAME='amavisd-new.schema'

    export AMAVISD_CONF='/etc/amavisd.conf'
    export AMAVISD_VIRUSMAILS_DIR='/var/virusmails'

    export AMAVISD_DKIM_CONF="${AMAVISD_CONF}"
    export AMAVISD_MYHOME='/var/amavis'
    export AMAVISD_QUARANTINEDIR="${AMAVISD_MYHOME}/quarantine"
    export AMAVISD_TEMPDIR="${AMAVISD_MYHOME}/tmp"

    export AMAVISD_DB_MYSQL_TMPL="${SAMPLE_DIR}/amavisd-2.7.0.mysql"
elif [ X"${DISTRO}" == X"FREEBSD" ]; then
    # Override global setting: user/group.
    export AMAVISD_SYS_USER='vscan'
    export AMAVISD_SYS_GROUP='vscan'

    export AMAVISD_BIN='/usr/local/sbin/amavisd'
    export AMAVISD_CONF='/usr/local/etc/amavisd.conf'
    export AMAVISD_DKIM_CONF='/usr/local/etc/amavisd.conf'
    export AMAVISD_RC_SCRIPT_NAME='amavisd'
    export AMAVISD_LDAP_SCHEMA_NAME='amavisd-new.schema'
    export AMAVISD_VIRUSMAILS_DIR='/var/virusmails'

    # Override location of command 'altermime'
    export ALTERMIME_BIN='/usr/local/bin/altermime'
else
    :
fi

# Syslog setting, 'YES' or 'NO'
export AMAVISD_SEPERATE_LOG='NO'
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.