Commits

Zhang Huangbin committed ac14810

Fixed: Enable share folder in Dovecot-2.

Comments (0)

Files changed (1)

iRedMail/functions/dovecot2.sh

     fi
 
     # IMAP shared folder
-    if [ X"${DOVECOT_VERSION}" == X"1.2" ]; then
-        backup_file ${DOVECOT_SHARE_FOLDER_CONF}
+    backup_file ${DOVECOT_SHARE_FOLDER_CONF}
 
-        if [ X"${BACKEND}" == X"OPENLDAP" ]; then
-            share_folder_db_name="${IREDADMIN_DB_NAME}"
-            share_folder_db_user="${IREDADMIN_DB_USER}"
-            share_folder_db_passwd="${IREDADMIN_DB_PASSWD}"
-        elif [ X"${BACKEND}" == X"MYSQL" ]; then
-            share_folder_db_name="${VMAIL_DB}"
-            share_folder_db_user="${VMAIL_DB_ADMIN_USER}"
-            share_folder_db_passwd="${VMAIL_DB_ADMIN_PASSWD}"
-        elif [ X"${BACKEND}" == X"PGSQL" ]; then
-            share_folder_db_name="${VMAIL_DB}"
-            share_folder_db_user="${VMAIL_DB_ADMIN_USER}"
-            share_folder_db_passwd="${VMAIL_DB_ADMIN_PASSWD}"
-        fi
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
+        share_folder_db_name="${IREDADMIN_DB_NAME}"
+        share_folder_db_user="${IREDADMIN_DB_USER}"
+        share_folder_db_passwd="${IREDADMIN_DB_PASSWD}"
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
+        share_folder_db_name="${VMAIL_DB}"
+        share_folder_db_user="${VMAIL_DB_ADMIN_USER}"
+        share_folder_db_passwd="${VMAIL_DB_ADMIN_PASSWD}"
+    elif [ X"${BACKEND}" == X"PGSQL" ]; then
+        share_folder_db_name="${VMAIL_DB}"
+        share_folder_db_user="${VMAIL_DB_ADMIN_USER}"
+        share_folder_db_passwd="${VMAIL_DB_ADMIN_PASSWD}"
+    fi
 
-        # Enable dict quota in dovecot.
-        cat >> ${DOVECOT_CONF} <<EOF
+    # Enable dict quota in dovecot.
+    cat >> ${DOVECOT_CONF} <<EOF
 namespace private {
     separator = /
     prefix =
 }
 EOF
 
-        # SQL lookup for share folder.
-        cat > ${DOVECOT_SHARE_FOLDER_CONF} <<EOF
+    # SQL lookup for share folder.
+    cat > ${DOVECOT_SHARE_FOLDER_CONF} <<EOF
 ${CONF_MSG}
 connect = host=${MYSQL_SERVER} dbname=${share_folder_db_name} user=${share_folder_db_user} password=${share_folder_db_passwd}
 map {
     }
 }
 EOF
-        chmod 0500 ${DOVECOT_SHARE_FOLDER_CONF}
+    chmod 0500 ${DOVECOT_SHARE_FOLDER_CONF}
 
-        # Create MySQL database ${IREDADMIN_DB_USER} and table 'share_folder'
-        # which used to store realtime quota.
-        if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
-            # If iRedAdmin is not used, create database and import table here.
-            mysql -h${MYSQL_SERVER} -P${MYSQL_SERVER_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
+    # Create MySQL database ${IREDADMIN_DB_USER} and table 'share_folder'
+    # which used to store realtime quota.
+    if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
+        # If iRedAdmin is not used, create database and import table here.
+        mysql -h${MYSQL_SERVER} -P${MYSQL_SERVER_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 # Create databases.
 CREATE DATABASE IF NOT EXISTS ${IREDADMIN_DB_NAME} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 
 
 FLUSH PRIVILEGES;
 EOF
-        fi
     fi
 
     ECHO_DEBUG "Copy sample sieve global filter rule file: ${DOVECOT_GLOBAL_SIEVE_FILE}.sample."
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.