Commits

Zhang Huangbin committed 908bd98

Code cleanup.

  • Participants
  • Parent commits cfa8e95

Comments (0)

Files changed (3)

File iRedMail/functions/cleanup.sh

                     else
                         # openSUSE will use /etc/init.d/SuSEfirewall2_{init,setup} instead.
                         if [ X"${DISTRO}" != X"SUSE" ]; then
-                            ${DIR_RC_SCRIPTS}/iptables restart
+                            ${DIR_RC_SCRIPTS}/iptables restart >/dev/null
                         fi
                     fi
                     ;;
     [ X"${BACKEND}" == X'PGSQL' ] && check_status_before_run cleanup_pgsql_force_password
 
     # Start Dovecot to deliver emails.
-    bash -xv ${DIR_RC_SCRIPTS}/${DOVECOT_RC_SCRIPT_NAME} restart #&>/dev/null
+    ECHO_INFO "Deliver administration emails to ${FIRST_USER}@${FIRST_DOMAIN}."
+    [ X"${BACKEND}" == X'OPENLDAP' ] && ${DIR_RC_SCRIPTS}/${OPENLDAP_RC_SCRIPT_NAME} restart &>/dev/null
+    [ X"${BACKEND}" == X'MYSQL' ] && ${DIR_RC_SCRIPTS}/${MYSQL_RC_SCRIPT_NAME} restart &>/dev/null
+    [ X"${BACKEND}" == X'PGSQL' ] && ${DIR_RC_SCRIPTS}/${PGSQL_RC_SCRIPT_NAME} restart &>/dev/null
+    ${DIR_RC_SCRIPTS}/${DOVECOT_RC_SCRIPT_NAME} restart &>/dev/null
     sleep 3
 
     # Send tip file to the mail server admin and/or first mail user.

File iRedMail/functions/cluebringer.sh

 
     # IP to listen on, * for all
     perl -pi -e 's/^(host=).*/${1}$ENV{CLUEBRINGER_BIND_HOST}/' ${CLUEBRINGER_CONF}
+    perl -pi -e 's/^#(host=).*/${1}$ENV{CLUEBRINGER_BIND_HOST}/' ${CLUEBRINGER_CONF}
     # Port to run on
     perl -pi -e 's/^#(port=).*/${1}$ENV{CLUEBRINGER_BIND_PORT}/' ${CLUEBRINGER_CONF}
 
+    # How many seconds before we retry a DB connection
+    perl -pi -e 's/^#(bypass_timeout=).*/${1}10/' ${CLUEBRINGER_CONF}
+    perl -pi -e 's#^(bypass_timeout=).*#${1}10#' ${CLUEBRINGER_CONF}
+
     #
     # Configure '[database]' section.
     #
     # Get SQL structure template file.
     tmp_sql="/tmp/cluebringer_init_sql.${RANDOM}${RANDOM}"
     if [ X"${DISTRO}" == X"RHEL" -o X"${DISTRO}" == X"SUSE" ]; then
-        DB_SAMPLE_FILE_NAME='DATABASE.mysql'
+        DB_SAMPLE_FILE_NAME='policyd.mysql.sql'
 
         if [ X"${DISTRO}" == X'SUSE' ]; then
-            DB_SAMPLE_FILE_NAME='policyd.mysql.sql'
             cat > ${tmp_sql} <<EOF
 CREATE DATABASE ${CLUEBRINGER_DB_NAME};
 USE ${CLUEBRINGER_DB_NAME};

File iRedMail/samples/dovecot/dovecot-ldap.conf

 #iterate_filter  = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail))
 
 user_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
-user_attrs      = mail=user,mail=master_user,homeDirectory=home,=mail=maildir:~/Maildir/,mailQuota=quota_rule=*:bytes=%$
+user_attrs      = mail=user,homeDirectory=home,=mail=maildir:~/Maildir/,mailQuota=quota_rule=*:bytes=%$
 pass_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
 pass_attrs      = mail=user,userPassword=password
 default_pass_scheme = CRYPT