Commits

Zhang Huangbin  committed f5a0d22

Drop support for below distribution releases:
+ Ubuntu 12.10
+ RHEL/CENTOS 5.x

  • Participants
  • Parent commits 176bc00

Comments (0)

Files changed (13)

File iRedMail/ChangeLog

       - OpenLDAP: attribute 'preferredLanguage' for mailDomain object
 
     * Drop support for below releases:
+        + Ubuntu 12.10
+        + RHEL/CentOS 5.x
         + OpenBSD 5.1, 5.2.
         + openSUSE 12.1, 12.2.
 

File iRedMail/conf/amavisd

     export AMAVISD_QUARANTINEDIR="${AMAVISD_MYHOME}/quarantine"
     export AMAVISD_TEMPDIR="${AMAVISD_MYHOME}/tmp"
 
-    if [ X"${DISTRO_VERSION}" == X"5" ]; then
-        export AMAVISD_CONF='/etc/amavisd.conf'
-    elif [ X"${DISTRO_VERSION}" == X"6" ]; then
-        export AMAVISD_CONF='/etc/amavisd/amavisd.conf'
-        export AMAVISD_VIRUSMAILS_DIR="${AMAVISD_QUARANTINEDIR}"
-    fi
+    # RHEL/CENTOS 6
+    export AMAVISD_CONF='/etc/amavisd/amavisd.conf'
+    export AMAVISD_VIRUSMAILS_DIR="${AMAVISD_QUARANTINEDIR}"
 
     export AMAVISD_DKIM_CONF="${AMAVISD_CONF}"
 
     export AMAVISD_VIRUSMAILS_DIR='/var/spool/amavis/virusmails'
 
 elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-    # Debian 7 (wheezy) and Ubuntu 12.10 (quantal) ships Amavisd-new-2.7
+    # Debian 7 (wheezy) and Ubuntu 13.04 (raring) ships Amavisd-new-2.7
     if [ X"${DISTRO}" == X'DEBIAN' ]; then
         if [ X"${DISTRO_CODENAME}" != X'squeeze' ]; then
             export AMAVISD_VERSION='2.7'

File iRedMail/conf/awstats

 # Config files.
 if [ X"${DISTRO}" == X"RHEL" ]; then
     export AWSTATS_CONF_SAMPLE="${AWSTATS_CONF_DIR}/awstats.localhost.localdomain.conf"
-    if [ X"${DISTRO_VERSION}" == X'5' ]; then
-        export AWSTATS_HTTPD_ROOT="${HTTPD_SERVERROOT}/awstats"
-        export AWSTATS_CGI_DIR="${AWSTATS_HTTPD_ROOT}"
-    else
-        export AWSTATS_HTTPD_ROOT="/usr/share/awstats/wwwroot"
-        export AWSTATS_CGI_DIR="${AWSTATS_HTTPD_ROOT}/cgi-bin"
-    fi
+    export AWSTATS_HTTPD_ROOT="/usr/share/awstats/wwwroot"
+    export AWSTATS_CGI_DIR="${AWSTATS_HTTPD_ROOT}/cgi-bin"
     export AWSTATS_ICON_DIR="${AWSTATS_HTTPD_ROOT}/icon"
     export AWSTATS_CSS_DIR="${AWSTATS_HTTPD_ROOT}/css"
     export AWSTATS_JS_DIR="${AWSTATS_HTTPD_ROOT}/js"

File iRedMail/conf/clamav

 
 # Clamav.
 if [ X"${DISTRO}" == X"RHEL" ]; then
-    if [ X"${DISTRO_VERSION}" != X'5' ]; then
-        export CLAMAV_USER='clam'
-        export CLAMAV_GROUP='clam'
-    fi
+    export CLAMAV_USER='clam'
+    export CLAMAV_GROUP='clam'
     # Freshclam.
     export FRESHCLAM_INIT_FILE_SAMPLE="${SAMPLE_DIR}/freshclam.init"
 

File iRedMail/conf/dovecot

 # Path to Dovecot deliver agant
 export DOVECOT_DELIVER='/usr/libexec/dovecot/deliver'
 
-if [ X"${DISTRO}" == X"RHEL" ]; then
-    if [ X"${DISTRO_VERSION}" == X"5" ]; then
-        export DOVECOT_VERSION='1.2'
-        export DOVECOT_CONF_DIR='/etc'
-    fi
-elif [ X"${DISTRO}" == X"SUSE" ]; then
+if [ X"${DISTRO}" == X"SUSE" ]; then
     export DOVECOT_DELIVER='/usr/lib/dovecot/deliver'
 
 elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then

File iRedMail/conf/global

 # Dovecot: POP3, IMAP, managesieve
 export IMAP_SERVER="${LOCAL_ADDRESS}"
 export MANAGESIEVE_BIND_HOST="${LOCAL_ADDRESS}"
+export MANAGESIEVE_PORT='4190'
 # SMTP server (Postfix)
 export SMTP_SERVER="${LOCAL_ADDRESS}"
 # Amavisd
         export DISTRO='RHEL'
 
         # Get distribution version
-        if grep '\ 5' /etc/redhat-release &>/dev/null; then
-            # version 5.x
-            export DISTRO_VERSION='5'
-        elif grep '\ 6' /etc/redhat-release &>/dev/null; then
+        if grep '\ 6' /etc/redhat-release &>/dev/null; then
             # version 6.x
             export DISTRO_VERSION='6'
         else
 
         # Ubuntu version number and code name:
         #   - 12.04: precise (Long Term support by Ubuntu)
-        #   - 12.10: quantal
         #   - 13.04: raring
         export DISTRO_ID="$(grep 'DISTRIB_ID' /etc/lsb-release | awk -F'=' '{print $2}')"
         export DISTRO_VERSION="$(grep 'DISTRIB_RELEASE' /etc/lsb-release | awk -F'=' '{print $2}')"
         #   - 10.10: maverick
         #   - 11.04: natty
         #   - 11.10: oneiric
+        #   - 12.10: quantal
         if [ X"${DISTRO_CODENAME}" == X'hardy' \
             -o X"${DISTRO_CODENAME}" == X'intrepid' \
             -o X"${DISTRO_CODENAME}" == X'jaunty' \
             -o X"${DISTRO_CODENAME}" == X'maverick' \
             -o X"${DISTRO_CODENAME}" == X'natty' \
             -o X"${DISTRO_CODENAME}" == X'oneiric' \
+            -o X"${DISTRO_CODENAME}" == X'quantal' \
             ]; then
             export UNSUPPORTED_RELEASE='YES'
         fi
     export enable_service='enable_service_rh'
     export disable_service='disable_service_rh'
 
-    # Syslog config file: syslog.
-    if [ X"${DISTRO_VERSION}" == X"5" ]; then
-        export SYSLOG_CONF='/etc/syslog.conf'
-    else
-        export SYSLOG_CONF='/etc/rsyslog.conf'
-    fi
+    # Syslog config file: rsyslog.
+    export SYSLOG_CONF='/etc/rsyslog.conf'
     export SYSLOG_POSTROTATE_CMD='/bin/kill -HUP $(cat /var/run/syslogd.pid 2> /dev/null) 2> /dev/null || true'
 
     # Crontab related.

File iRedMail/conf/managesieve

-#!/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 managesieve service.
-# MANAGESIEVE_BIND_HOST is configured in conf/global
-export MANAGESIEVE_PORT='4190'
-
-# Old Linux releases use port 2000.
-if [ X"${DISTRO}" == X'RHEL' ]; then
-    # RHEL 5
-    [ X"${DISTRO_VERSION}" == X"5" ] && export MANAGESIEVE_PORT='2000'
-fi

File iRedMail/conf/openldap

 
 # Variables for OpenLDAP and related. Refer to 'dialog/ldap_config.sh'.
 
+# OpenLDAP version number.
+export OPENLDAP_VERSION='2.4'
+
 # LDAP service info.
 # LDAP_SERVER_HOST is configured in conf/global
 export LDAP_SERVER_PORT='389'
 
 # Configure.
 if [ X"${DISTRO}" == X"RHEL" ]; then
-    # OpenLDAP version.
-    if [ X"${DISTRO_VERSION}" == X"5" ]; then
-        export OPENLDAP_VERSION='2.3'
-        export OPENLDAP_RC_SCRIPT_NAME='ldap'
-    else
-        export OPENLDAP_VERSION='2.4'
-    fi
 
     export OPENLDAP_DB_CONFIG_SAMPLE="${OPENLDAP_CONF_ROOT}/DB_CONFIG.example"
     export OPENLDAP_SYSCONFIG_CONF="${ETC_SYSCONFIG_DIR}/ldap"
     fi
 
 elif [ X"${DISTRO}" == X"SUSE" ]; then
-    # OpenLDAP version.
-    export OPENLDAP_VERSION='2.4'
-
     export OPENLDAP_DB_CONFIG_SAMPLE='/var/lib/ldap/DB_CONFIG.example'
 
     export OPENLDAP_PID_FILE='/var/run/slapd/slapd.pid'
     export OPENLDAP_RC_SCRIPT_NAME='ldap'
 
 elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-    # OpenLDAP version.
-    export OPENLDAP_VERSION='2.4'
-
     # LDAP daemon user & group.
     export OPENLDAP_DAEMON_USER='openldap'
     export OPENLDAP_DAEMON_GROUP='openldap'
     export OPENLDAP_MODULE_PATH='/usr/lib/ldap'
 
 elif [ X"${DISTRO}" == X"GENTOO" ]; then
-    # OpenLDAP version.
-    export OPENLDAP_VERSION='2.4'
-
     export OPENLDAP_DB_CONFIG_SAMPLE="${OPENLDAP_CONF_ROOT}/DB_CONFIG.example"
     export OPENLDAP_SYSCONFIG_CONF="${ETC_SYSCONFIG_DIR}/slapd"
 
     export OPENLDAP_DATA_DIR='/var/lib/openldap-data'
 
 elif [ X"${DISTRO}" == X"FREEBSD" ]; then
-    # OpenLDAP version.
-    export OPENLDAP_VERSION='2.4'
-
     # Configuration files.
     export OPENLDAP_CONF_ROOT='/usr/local/etc/openldap'
     export OPENLDAP_DB_CONFIG_SAMPLE="${OPENLDAP_CONF_ROOT}/DB_CONFIG.example"
     export OPENLDAP_DATA_DIR='/var/db/openldap-data'    # Do *NOT* end with '/'.
 
 elif [ X"${DISTRO}" == X'OPENBSD' ]; then
-    # OpenLDAP version.
-    export OPENLDAP_VERSION='2.4'
-
     # LDAP daemon user & group.
     export OPENLDAP_DAEMON_USER='_openldap'
     export OPENLDAP_DAEMON_GROUP='_openldap'

File iRedMail/conf/postgresql

 export PGSQL_INIT_SQL_SAMPLE="${CONF_DIR}/pgsql_init.pgsql"
 
 if [ X"${DISTRO}" == X'RHEL' ]; then
-    if [ X"${DISTRO_VERSION}" == X'5' ]; then
-        export PGSQL_VERSION='8.1'
-    elif [ X"${DISTRO_VERSION}" == X'6' ]; then
-        export PGSQL_VERSION='8.4'
-    fi
+    # RHEL/CENTOS 6
+    export PGSQL_VERSION='8.4'
     export PGSQL_SYS_USER_HOME='/var/lib/pgsql'
     export PGSQL_DATA_DIR="${PGSQL_SYS_USER_HOME}/data"
 

File iRedMail/functions/clamav.sh

     perl -pi -e 's/^#(OfficialDatabaseOnly ).*/${1} yes/' ${CLAMD_CONF}
 
     if [ X"${DISTRO}" == X"RHEL" ]; then
-        if [ X"${DISTRO_VERSION}" != X'5' ]; then
-            ECHO_DEBUG "Add clamav user to amavid group."
-            usermod ${CLAMAV_USER} -G ${AMAVISD_SYS_GROUP}
+        ECHO_DEBUG "Add clamav user to amavid group."
+        usermod ${CLAMAV_USER} -G ${AMAVISD_SYS_GROUP}
 
-            ECHO_DEBUG "Set permission to 750: ${AMAVISD_TEMPDIR}, ${AMAVISD_QUARANTINEDIR},"
-            chmod -R 750 ${AMAVISD_TEMPDIR} ${AMAVISD_QUARANTINEDIR}
-        fi
+        ECHO_DEBUG "Set permission to 750: ${AMAVISD_TEMPDIR}, ${AMAVISD_QUARANTINEDIR},"
+        chmod -R 750 ${AMAVISD_TEMPDIR} ${AMAVISD_QUARANTINEDIR}
 
-        ECHO_DEBUG "Copy freshclam init startup script and enable it."
-        cp -f ${FRESHCLAM_INIT_FILE_SAMPLE} /etc/rc.d/init.d/freshclam
-        chmod +x /etc/rc.d/init.d/freshclam
-        eval ${enable_service} freshclam
-        export ENABLED_SERVICES="${ENABLED_SERVICES} freshclam"
+        #ECHO_DEBUG "Copy freshclam init startup script and enable it."
+        #cp -f ${FRESHCLAM_INIT_FILE_SAMPLE} /etc/rc.d/init.d/freshclam
+        #chmod +x /etc/rc.d/init.d/freshclam
+        #eval ${enable_service} freshclam
+        #export ENABLED_SERVICES="${ENABLED_SERVICES} freshclam"
     elif [ X"${DISTRO}" == X"FREEBSD" ]; then
         ECHO_DEBUG "Add clamav user to amavid group."
         pw usermod ${CLAMAV_USER} -G ${AMAVISD_SYS_GROUP}

File iRedMail/functions/packages.sh

     #
     ENABLED_SERVICES="${ENABLED_SERVICES} ${HTTPD_RC_SCRIPT_NAME}"
     if [ X"${DISTRO}" == X"RHEL" ]; then
-        ALL_PKGS="${ALL_PKGS} httpd${PKG_ARCH} mod_ssl${PKG_ARCH}"
-
-        if [ X"${DISTRO_VERSION}" == X"5" ]; then
-            ALL_PKGS="${ALL_PKGS} php53${PKG_ARCH} php53-common${PKG_ARCH} php53-gd${PKG_ARCH} php53-xml${PKG_ARCH} php53-mysql${PKG_ARCH} php53-ldap${PKG_ARCH} php53-pgsql${PKG_ARCH} php53-imap${PKG_ARCH} php53-mbstring${PKG_ARCH}"
-        else
-            ALL_PKGS="${ALL_PKGS} php${PKG_ARCH} php-common${PKG_ARCH} php-gd${PKG_ARCH} php-xml${PKG_ARCH} php-mysql${PKG_ARCH} php-ldap${PKG_ARCH} php-pgsql${PKG_ARCH} php-imap${PKG_ARCH} php-mbstring${PKG_ARCH}"
-        fi
+        ALL_PKGS="${ALL_PKGS} httpd${PKG_ARCH} mod_ssl${PKG_ARCH} php${PKG_ARCH} php-common${PKG_ARCH} php-gd${PKG_ARCH} php-xml${PKG_ARCH} php-mysql${PKG_ARCH} php-ldap${PKG_ARCH} php-pgsql${PKG_ARCH} php-imap${PKG_ARCH} php-mbstring${PKG_ARCH}"
 
     elif [ X"${DISTRO}" == X"SUSE" ]; then
         # Apache
     # Dovecot.
     ENABLED_SERVICES="${ENABLED_SERVICES} ${DOVECOT_RC_SCRIPT_NAME}"
     if [ X"${DISTRO}" == X"RHEL" ]; then
-        if [ X"${DISTRO_VERSION}" == X"5" ]; then
-            ALL_PKGS="${ALL_PKGS} dovecot${PKG_ARCH} dovecot-sieve${PKG_ARCH} dovecot-managesieve${PKG_ARCH}"
-        elif [ X"${DISTRO_VERSION}" == X"6" ]; then
-            ALL_PKGS="${ALL_PKGS} dovecot${PKG_ARCH} dovecot-managesieve${PKG_ARCH} dovecot-pigeonhole${PKG_ARCH}"
-        fi
+        ALL_PKGS="${ALL_PKGS} dovecot${PKG_ARCH} dovecot-managesieve${PKG_ARCH} dovecot-pigeonhole${PKG_ARCH}"
 
         # We use Dovecot SASL auth instead of saslauthd
         DISABLED_SERVICES="${DISABLED_SERVICES} saslauthd"
     # Amavisd-new & ClamAV & Altermime.
     ENABLED_SERVICES="${ENABLED_SERVICES} ${CLAMAV_CLAMD_RC_SCRIPT_NAME} ${AMAVISD_RC_SCRIPT_NAME}"
     if [ X"${DISTRO}" == X"RHEL" ]; then
-        ALL_PKGS="${ALL_PKGS} clamd${PKG_ARCH} clamav${PKG_ARCH} clamav-db${PKG_ARCH} spamassassin${PKG_ARCH} altermime${PKG_ARCH} perl-LDAP.noarch perl-Mail-SPF.noarch"
-
-        if [ X"${DISTRO_VERSION}" == X"5" ]; then
-            ALL_PKGS="${ALL_PKGS} amavisd-new${PKG_ARCH} perl-IO-Compress.noarch"
-        else
-            ALL_PKGS="${ALL_PKGS} amavisd-new.noarch"
-        fi
+        ALL_PKGS="${ALL_PKGS} clamd${PKG_ARCH} clamav${PKG_ARCH} clamav-db${PKG_ARCH} spamassassin${PKG_ARCH} altermime${PKG_ARCH} perl-LDAP.noarch perl-Mail-SPF.noarch amavisd-new.noarch"
 
         if [ X"${BACKEND}" == X'PGSQL' ]; then
             ALL_PKGS="${ALL_PKGS} perl-DBD-Pg"
     #
     if [ X"${DISTRO}" == X"RHEL" ]; then
         ALL_PKGS="${ALL_PKGS} bzip2${PKG_ARCH} acl${PKG_ARCH} patch${PKG_ARCH} tmpwatch${PKG_ARCH} crontabs.noarch dos2unix${PKG_ARCH} logwatch"
-        if [ X"${DISTRO_VERSION}" == X"5" ]; then
-            ALL_PKGS="${ALL_PKGS} vixie-cron${PKG_ARCH}"
-        fi
         ENABLED_SERVICES="${ENABLED_SERVICES} crond"
     elif [ X"${DISTRO}" == X"SUSE" ]; then
         ALL_PKGS="${ALL_PKGS} bzip2 acl patch cron tmpwatch dos2unix logwatch"

File iRedMail/iRedMail.sh

 . ${CONF_DIR}/policy_server
 . ${CONF_DIR}/iredapd
 . ${CONF_DIR}/dovecot
-. ${CONF_DIR}/managesieve
 . ${CONF_DIR}/amavisd
 . ${CONF_DIR}/clamav
 . ${CONF_DIR}/spamassassin

File iRedMail/pkgs/get_all.sh

 gpgcheck=0
 EOF
 
-    # Dovecot-1.2 for RHEL 5.
-    if [ X"${DISTRO_VERSION}" == X"5" ]; then
-        cat >> ${LOCAL_REPO_FILE} <<EOF
-[iRedMail-Dovecot-12]
-name=iRedMail-Dovecot-12
-baseurl=${IREDMAIL_MIRROR}/yum/rpms/dovecot/rhel${DISTRO_VERSION}/
-enabled=1
-gpgcheck=0
-EOF
-    fi
-
     ECHO_INFO "Clean metadata of yum repositories."
     yum clean metadata
 
-    # RHEL/CentOS 6 only. EPEL for RHEL 5 is out of date.
+    # RHEL/CentOS 6.
     # Create a temporary yum repo to install epel-release without GPG check.
-    if [ X"${DISTRO_VERSION}" == X'6' ]; then
-        cat > ${YUM_REPOS_DIR}/tmp_epel.repo <<EOF
+    cat > ${YUM_REPOS_DIR}/tmp_epel.repo <<EOF
 [tmp_epel]
 name=Extra Packages for Enterprise Linux ${DISTRO_VERSION} - \$basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/${DISTRO_VERSION}/\$basearch
 enabled=1
 gpgcheck=0
 EOF
-        ECHO_INFO "Install epel yum repo."
-        eval ${install_pkg} epel-release && rm ${YUM_REPOS_DIR}/tmp_epel.repo
-        yum clean metadata
-    fi
+
+    ECHO_INFO "Install epel yum repo."
+    eval ${install_pkg} epel-release && rm ${YUM_REPOS_DIR}/tmp_epel.repo
+    yum clean metadata
 
     echo 'export status_create_yum_repo="DONE"' >> ${STATUS_FILE}
 }