Zhang Huangbin avatar Zhang Huangbin committed a398667

It now works on Debian wheezy. Tested with Debian wheezy alpha 1.

Comments (0)

Files changed (16)

iRedMail/ChangeLog

 iRedMail-0.8.1:
+    * It now works on Debian wheezy. Tested with Debian wheezy alpha 1.
     * Drop support for Linux Mint. Sorry, not a server OS.
     * Add new column 'mailbox.language' in MySQL & PGSQL backends, used by
       iRedAdmin.

iRedMail/conf/dovecot

 elif [ X"${DISTRO}" == X"SUSE" ]; then
     export DOVECOT_DELIVER='/usr/lib/dovecot/deliver'
 
-elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-    if [ X"${DISTRO}" == X"DEBIAN" ]; then
+elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+    if [ X"${DISTRO_CODENAME}" == X'squeeze' \
+        -o X"${DISTRO_CODENAME}" == X'lucid' \
+        ]; then
         export DOVECOT_VERSION='1.2'
-    elif [ X"${DISTRO}" == X"UBUNTU" ]; then
-        if [ X"${DISTRO_CODENAME}" == X"lucid" ]; then
-            # Ubuntu 10.04
-            export DOVECOT_VERSION='1.2'
-        fi
     fi
 
     export DOVECOT_DELIVER='/usr/lib/dovecot/deliver'

iRedMail/conf/global

         export DISTRO='DEBIAN'
 
         # Get major release version number
-        export DISTRO_VERSION="$(cat /etc/debian_version | cut -b 1)"
+        export DISTRO_VERSION="$(cat /etc/debian_version)"
 
-        # Set distro code name and unsupported releases:
-        # - 4: Etch
-        # - 5: Lenny
-        if [ X"${DISTRO_VERSION}" == X'6' ]; then
+        # Set distro code name and unsupported releases.
+        if grep '^6' /etc/debian_version &>/dev/null; then
+            export DISTRO_VERSION='6'
             export DISTRO_CODENAME='squeeze'
-
-            # Override settings.
-            export SHELL_NOLOGIN='/usr/sbin/nologin'
+        elif grep '^7' /etc/debian_version &>/dev/null || \
+            grep -i '^wheezy' /etc/debian_version &>/dev/null; then
+            export DISTRO_VERSION='7'
+            export DISTRO_CODENAME='wheezy'
+            export ENABLE_BACKEND_PGSQL='YES'
         else
             export UNSUPPORTED_RELEASE='YES'
         fi
 
+        # Override settings.
+        export SHELL_NOLOGIN='/usr/sbin/nologin'
+
     elif [ -f /etc/gentoo-release ]; then
         # Gentoo
         export DISTRO='GENTOO'

iRedMail/conf/phpldapadmin

 # Install phpLDAPadmin with source tarball.
 export PHPLDAPADMIN_USE_SOURCE='YES'
 
-if [ X"${DISTRO}" == X"FREEBSD" -o X"${DISTRO}" == X'OPENBSD' ]; then
+if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+    # Install phpLDAPadmin via apt repo. 
+    export PHPLDAPADMIN_USE_SOURCE='NO'
+
+    export PLA_HTTPD_ROOT="/usr/share/phpldapadmin"
+    export PLA_HTTPD_ROOT_SYMBOL_LINK="${PLA_HTTPD_ROOT}"
+    export PLA_CONF_DIR="${PLA_HTTPD_ROOT}/config"
+
+elif [ X"${DISTRO}" == X"FREEBSD" -o X"${DISTRO}" == X'OPENBSD' ]; then
     # Install phpLDAPadmin via ports tree.
     export PHPLDAPADMIN_USE_SOURCE='NO'
 
     export PLA_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpldapadmin/htdocs"
     export PLA_HTTPD_ROOT_SYMBOL_LINK="${PLA_HTTPD_ROOT}"
     export PLA_CONF_DIR="${HTTPD_SERVERROOT}/phpldapadmin/config"
+
 else
     export PLA_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpldapadmin-${PLA_VERSION}"
     export PLA_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/phpldapadmin"
     export PLA_CONF_DIR="${PLA_HTTPD_ROOT_SYMBOL_LINK}/config"
 fi
-
-# Debian 6, Ubuntu 10.04, 10.10.
-if [ X"${DISTRO_CODENAME}" == X"squeeze" -o X"${DISTRO_CODENAME}" == X"lucid" ]; then
-    export PHPLDAPADMIN_USE_SOURCE='NO'
-
-    export PLA_HTTPD_ROOT="/usr/share/phpldapadmin"
-    export PLA_HTTPD_ROOT_SYMBOL_LINK="${PLA_HTTPD_ROOT}"
-    export PLA_CONF_DIR="${PLA_HTTPD_ROOT}/config"
-fi

iRedMail/conf/policy_server

         export USE_CLUEBRINGER='YES'
         export USE_POLICYD='NO'
     fi
+elif [ X"${DISTRO}" == X'DEBIAN' ]; then
+    if [ X"${DISTRO_CODENAME}" == X'wheezy' ]; then
+        export USE_CLUEBRINGER='YES'
+        export USE_POLICYD='NO'
+    fi
+
 elif [ X"${DISTRO}" == X'UBUNTU' ]; then
     if [ X"${DISTRO_CODENAME}" == X"oneiric" \
         -o X"${DISTRO_CODENAME}" == X"precise" \

iRedMail/dialog/config_via_dialog.sh

 . ${CONF_DIR}/core
 . ${CONF_DIR}/openldap
 . ${CONF_DIR}/postfix
-. ${CONF_DIR}/roundcube
 
 trap "exit 255" 2
 
 echo "export LDAP_BINDPW='${LDAP_BINDPW}'" >> ${CONFIG_FILE}
 echo "export LDAP_ADMIN_PW='${LDAP_ADMIN_PW}'" >> ${CONFIG_FILE}
 
-echo "export RCM_DB_USER='${RCM_DB_USER}'" >> ${CONFIG_FILE}
-echo "export RCM_DB_PASSWD='${RCM_DB_PASSWD}'" >> ${CONFIG_FILE}
-
 if [ X"${BACKEND}" == X"OPENLDAP" ]; then
     . ${DIALOG_DIR}/ldap_config.sh
 

iRedMail/dialog/virtual_domain_config.sh

 echo "export FIRST_USER_PASSWD_PLAIN='${FIRST_USER_PASSWD_PLAIN}'" >>${CONFIG_FILE}
 rm -f /tmp/first_user_passwd
 
-#
-# Set first mail user as alias for root.
-#
-export MAIL_ALIAS_ROOT="${FIRST_USER}@${FIRST_DOMAIN}"
-echo "export MAIL_ALIAS_ROOT='${MAIL_ALIAS_ROOT}'" >> ${CONFIG_FILE}
-
 cat >> ${TIP_FILE} <<EOF
 Admin of domain ${FIRST_DOMAIN}:
     * Account: ${DOMAIN_ADMIN_NAME}@${FIRST_DOMAIN}
         - This account is a normal mail user.
         - You can login webmail with this account, login name is full email address.
 
-Alias for root user:
-    * Alias address: ${MAIL_ALIAS_ROOT}
-    * You can change it in file ${POSTFIX_FILE_ALIASES}, then execute command 'postalias ${POSTFIX_FILE_ALIASES}'.
-
 EOF

iRedMail/functions/amavisd.sh

 EOF
 
     # Add postfix alias for user: amavis.
-    if [ ! -z ${MAIL_ALIAS_ROOT} ]; then
-        echo "${AMAVISD_SYS_USER}: root" >> ${POSTFIX_FILE_ALIASES}
-        postalias hash:${POSTFIX_FILE_ALIASES} &>/dev/null
-    else
-        :
-    fi
+    echo "${AMAVISD_SYS_USER}: ${SYS_ROOT_USER}" >> ${POSTFIX_FILE_ALIASES}
+    postalias hash:${POSTFIX_FILE_ALIASES} &>/dev/null
 
     # Make sure that clamav is configured to init supplementary
     # groups when it drops priviledges, and that you add the

iRedMail/functions/apache_php.sh

 EOF
 
     if [ X"${DISTRO}" != X'OPENBSD' ]; then
-        echo "${HTTPD_USER}: root" >> ${POSTFIX_FILE_ALIASES}
+        echo "${HTTPD_USER}: ${SYS_ROOT_USER}" >> ${POSTFIX_FILE_ALIASES}
         postalias hash:${POSTFIX_FILE_ALIASES} &>/dev/null
     fi
 

iRedMail/functions/cleanup.sh

 
     # Send tip file to the mail server admin and/or first mail user.
     tip_recipient="${FIRST_USER}@${FIRST_DOMAIN}"
-    [ ! -z "${MAIL_ALIAS_ROOT}" -a X"${MAIL_ALIAS_ROOT}" != X"${tip_recipient}" ] && \
-        tip_recipient="${tip_recipient},${MAIL_ALIAS_ROOT}"
 
     cat > /tmp/.tips.eml <<EOF
 From: root@${HOSTNAME}

iRedMail/functions/cluebringer.sh

 
             # Append cluebringer default sql template.
             gunzip -c /usr/share/doc/postfix-cluebringer/database/policyd-db.mysql.gz >> ${tmp_sql}
-
-            if [ X"${DISTRO_CODENAME}" == X"oneiric" \
-                -o X"${DISTRO_CODENAME}" == X"precise" \
-                ]; then
-                # Convert 'TYPE=' to 'ENGINE='
-                perl -pi -e 's#TYPE=#ENGINE=#g' ${tmp_sql}
-            fi
+            perl -pi -e 's#TYPE=#ENGINE=#g' ${tmp_sql}
 
         elif [ X"${BACKEND}" == X"PGSQL" ]; then
             cat > ${tmp_sql} <<EOF
     endscript
 }
 EOF
-    else
-        :
     fi
 
     # Add postfix alias.
-    if [ ! -z ${MAIL_ALIAS_ROOT} ]; then
-        echo "cluebringer: ${MAIL_ALIAS_ROOT}" >> ${POSTFIX_FILE_ALIASES}
-        postalias hash:${POSTFIX_FILE_ALIASES} 2>/dev/null
-    else
-        :
-    fi
+    echo "${CLUEBRINGER_USER}: ${SYS_ROOT_USER}" >> ${POSTFIX_FILE_ALIASES}
+    postalias hash:${POSTFIX_FILE_ALIASES} 2>/dev/null
 
     # Tips.
     cat >> ${TIP_FILE} <<EOF

iRedMail/functions/iredadmin.sh

 {
     ECHO_INFO "Configure iRedAdmin (official web-based admin panel)."
 
+    echo "export IREDADMIN_DB_PASSWD='${IREDADMIN_DB_PASSWD}'" >> ${CONFIG_FILE}
+
     if [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" -o X"${DISTRO}" == X"SUSE" ]; then
         ECHO_DEBUG "Enable apache module: wsgi."
         a2enmod wsgi >/dev/null 2>&1
     # Modify iRedAdmin settings.
     # [general] section.
     ECHO_DEBUG "Configure general settings."
-    perl -pi -e 's#^(webmaster =).*#${1} $ENV{MAIL_ALIAS_ROOT}#' settings.ini
     perl -pi -e 's#^(storage_base_directory =).*#${1} $ENV{STORAGE_BASE_DIR}/$ENV{STORAGE_NODE}#' settings.ini
 
     # [iredadmin] section.

iRedMail/functions/packages.sh

         # Authentication modules
         ALL_PKGS="${ALL_PKGS} libapache2-mod-auth-mysql libapache2-mod-auth-pgsql"
 
-        if [ X"${DISTRO_CODENAME}" != X"oneiric" \
-            -a X"${DISTRO_CODENAME}" != X"precise" \
+        if [ X"${DISTRO_CODENAME}" == X'squeeze' \
+            -o X"${DISTRO_CODENAME}" == X'lucid' \
             ]; then
             ALL_PKGS="${ALL_PKGS} php5-mhash"
         fi
 
-        if [ X"${DISTRO_CODENAME}" == X"lucid" \
-            -o X"${DISTRO_CODENAME}" == X"oneiric" \
-            -o X"${DISTRO_CODENAME}" == X"precise" \
-            ]; then
+        if [ X"${DISTRO_CODENAME}" != X'squeeze' ]; then
             if [ X"${BACKEND}" == X"OPENLDAP" ]; then
                 ALL_PKGS="${ALL_PKGS} php-net-ldap2"
             fi
             ALL_PKGS="${ALL_PKGS} cluebringer"
             ENABLED_SERVICES="${ENABLED_SERVICES} ${CLUEBRINGER_RC_SCRIPT_NAME}"
         fi
+
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-        if [ X"${DISTRO_CODENAME}" == X"oneiric" \
-            -o X"${DISTRO_CODENAME}" == X"precise" \
-            ]; then
-            # Policyd-2.x, code name "cluebringer".
+        if [ X"${USE_CLUEBRINGER}" == X'YES' ]; then
             ALL_PKGS="${ALL_PKGS} postfix-cluebringer postfix-cluebringer-webui"
             ENABLED_SERVICES="${ENABLED_SERVICES} ${CLUEBRINGER_RC_SCRIPT_NAME}"
 
             ENABLED_SERVICES="${ENABLED_SERVICES} ${POLICYD_RC_SCRIPT_NAME}"
         fi
 
-
         if [ X"${DISTRO_CODENAME}" == X"lucid" ]; then
             # Don't invoke dbconfig-common on Ubuntu.
             dpkg-divert --rename /etc/dbconfig-common/postfix-policyd.conf
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} dovecot-imapd dovecot-pop3d"
 
-        if [ X"${DISTRO_CODENAME}" == X"oneiric" \
-            -o X"${DISTRO_CODENAME}" == X"precise" \
+        if [ X"${DISTRO_CODENAME}" != X'squeeze' \
+            -a X"${DISTRO_CODENAME}" != X'lucid' \
             ]; then
             ALL_PKGS="${ALL_PKGS} dovecot-managesieved dovecot-sieve"
 
 
     # phpMyAdmin
     if [ X"${USE_PHPMYADMIN}" == X"YES" ]; then
-        if [ X"${DISTRO}" == X'OPENBSD' ]; then
+        if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+            ALL_PKGS="${ALL_PKGS} phpmyadmin"
+        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
             ALL_PKGS="${ALL_PKGS} phpMyAdmin"
         fi
     fi
 
     # phpLDAPadmin
     if [ X"${USE_PHPLDAPADMIN}" == X"YES" ]; then
-        if [ X"${DISTRO}" == X'OPENBSD' ]; then
+        if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+            ALL_PKGS="${ALL_PKGS} phpldapadmin"
+        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
             ALL_PKGS="${ALL_PKGS} phpldapadmin"
         fi
     fi
     # Disable Ubuntu firewall rules, we have iptables init script and rule file.
     [ X"${DISTRO}" == X"UBUNTU" ] && export DISABLED_SERVICES="${DISABLED_SERVICES} ufw"
 
-    # Debian 6 and Ubuntu 10.04/10.10 special.
-    # Install binary packages of phpldapadmin-1.2.x and phpMyAdmin-3.x.
-    if [ X"${DISTRO_CODENAME}" == X"lucid" -o X"${DISTRO_CODENAME}" == X"squeeze" ]; then
-        # Install phpLDAPadmin.
-        if [ X"${USE_PHPLDAPADMIN}" == X"YES" ]; then
-            ALL_PKGS="${ALL_PKGS} phpldapadmin"
-        fi
-
-        # Install phpMyAdmin-3.x.
-        if [ X"${USE_PHPMYADMIN}" == X"YES" ]; then
-            ALL_PKGS="${ALL_PKGS} phpmyadmin"
-        fi
-    fi
     #
     # ---- End Ubuntu 10.04 special. ----
     #

iRedMail/functions/policyd.sh

     chmod 0600 ${CRON_SPOOL_DIR}/${POLICYD_USER}
 
     # Add postfix alias.
-    if [ ! -z ${MAIL_ALIAS_ROOT} ]; then
-        echo "policyd: root" >> ${POSTFIX_FILE_ALIASES}
-        postalias hash:${POSTFIX_FILE_ALIASES} 2>/dev/null
-    else
-        :
-    fi
+    echo "${POLICYD_USER}: ${SYS_ROOT_USER}" >> ${POSTFIX_FILE_ALIASES}
+    postalias hash:${POSTFIX_FILE_ALIASES} 2>/dev/null
 
     # Tips.
     cat >> ${TIP_FILE} <<EOF

iRedMail/functions/postfix.sh

     # Comment out default aliases for root
     perl -pi -e 's/^(root:.*)/#${1}/g' ${POSTFIX_FILE_ALIASES}
 
-    if [ ! -z ${MAIL_ALIAS_ROOT} ]; then
-        echo "root: ${MAIL_ALIAS_ROOT}" >> ${POSTFIX_FILE_ALIASES}
-    fi
-    postalias hash:${POSTFIX_FILE_ALIASES} &>/dev/null
-
     postconf -e alias_maps="hash:${POSTFIX_FILE_ALIASES}"
     postconf -e alias_database="hash:${POSTFIX_FILE_ALIASES}"
     postalias hash:${POSTFIX_FILE_ALIASES} 2>/dev/null

iRedMail/functions/roundcubemail.sh

 {
     ECHO_INFO "Configure Roundcube webmail."
 
+    echo "export RCM_DB_USER='${RCM_DB_USER}'" >> ${CONFIG_FILE}
+    echo "export RCM_DB_PASSWD='${RCM_DB_PASSWD}'" >> ${CONFIG_FILE}
+
     # FreeBSD: install via ports tree.
     if [ X"${DISTRO}" != X"FREEBSD" -a X"${DISTRO}" != X'OPENBSD' ]; then
         cd ${MISC_DIR}
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.