Zhang Huangbin avatar Zhang Huangbin committed 1dd64d0

Fixed: Incorrect per-user sieve_dir setting in Dovecot. Thanks cetex <oskar @cetex.se>.
LDA (Dovecot deliver) now will move SPAM to Junk folder by default.

Comments (0)

Files changed (5)

iRedMail/ChangeLog

 iRedMail-0.7.4:
+    * Fixed: Incorrect per-user sieve_dir setting in Dovecot.
+      Thanks cetex <oskar @cetex.se>.
+    * LDA (Dovecot deliver) now will move SPAM to Junk folder by default.
     * Add missing INDEXes for Amavisd database: msgs.mail_id, (msgs.content,
       msgs.time_num), quarantine.mail_id.
       Thanks rjnena <rjnena@gmail>, David <dcharbonnier@gmail>.

iRedMail/conf/dovecot

 # Default quota type: maildir, dict:user::proxy::quotadict (quotadict).
 export DOVECOT_QUOTA_TYPE='dict:user::proxy::quotadict'
 
+# A symbol link to global sieve rule file.
+export DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL='/etc/dovecot/dovecot.sieve'
+
 if [ X"${DISTRO}" == X"RHEL" ]; then
     export DOVECOT_VERSION='2'
     export DOVECOT_CONF='/etc/dovecot/dovecot.conf'
         export DOVECOT_VERSION='1.2'
         export DOVECOT_CONF='/etc/dovecot.conf'
         export DOVECOT_LDAP_CONF='/etc/dovecot-ldap.conf'
+        export DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL='/etc/dovecot.sieve'
         export DOVECOT_MYSQL_CONF='/etc/dovecot-mysql.conf'
         export DOVECOT_REALTIME_QUOTA_CONF='/etc/dovecot-used-quota.conf'
         export DOVECOT_SHARE_FOLDER_CONF='/etc/dovecot-share-folder.conf'
     export DOVECOT_MYSQL_CONF='/usr/local/etc/dovecot-mysql.conf'
     export DOVECOT_REALTIME_QUOTA_CONF='/usr/local/etc/dovecot-used-quota.conf'
     export DOVECOT_SHARE_FOLDER_CONF='/usr/local/etc/dovecot-share-folder.conf'
+    export DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL='/usr/local/etc/dovecot.sieve'
     export DOVECOT_DELIVER='/usr/local/libexec/dovecot/deliver'
 fi
 

iRedMail/functions/dovecot1.sh

     # ---- IMAP shared folder ----
 
     ECHO_DEBUG "Copy sample sieve global filter rule file: ${GLOBAL_SIEVE_FILE}.sample."
-    cp -f ${SAMPLE_DIR}/dovecot.sieve ${GLOBAL_SIEVE_FILE}.sample
-    chown ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME} ${GLOBAL_SIEVE_FILE}.sample
-    chmod 0500 ${GLOBAL_SIEVE_FILE}.sample
+    cp -f ${SAMPLE_DIR}/dovecot.sieve ${GLOBAL_SIEVE_FILE}
+    chown ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME} ${GLOBAL_SIEVE_FILE}
+    chmod 0500 ${GLOBAL_SIEVE_FILE}
+
+    # Create symbol link of global sieve rule.
+    rm -f ${DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL} &>/dev/null
+    ln -s ${GLOBAL_SIEVE_FILE} ${DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL}
 
     ECHO_DEBUG "Create dovecot log file: ${DOVECOT_LOG_FILE}, ${SIEVE_LOG_FILE}."
     touch ${DOVECOT_LOG_FILE} ${SIEVE_LOG_FILE}

iRedMail/functions/managesieve.sh

 
     # The path to the directory where the personal Sieve scripts are stored. For
     # ManageSieve this is where the uploaded scripts are stored.
-    sieve_dir = ${SIEVE_DIR}/%Ld/%Ln/
+    sieve_dir = ${SIEVE_DIR}/%Ld/%Ln
 }
 EOF
 

iRedMail/functions/roundcubemail.sh

     cd ${RCM_HTTPD_ROOT}/config/ && \
     perl -pi -e 's#(.*rcmail_config.*plugins.*=.*array\()(.*)#${1}"managesieve",${2}#' main.inc.php
 
-    export MANAGESIEVE_BINDADDR MANAGESIEVE_PORT
+    export MANAGESIEVE_BINDADDR MANAGESIEVE_PORT DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL
     cd ${RCM_HTTPD_ROOT}/plugins/managesieve/ && \
     cp config.inc.php.dist config.inc.php && \
     perl -pi -e 's#(.*managesieve_port.*=).*#${1} $ENV{'MANAGESIEVE_PORT'};#' config.inc.php
     perl -pi -e 's#(.*managesieve_host.*=).*#${1} "$ENV{'MANAGESIEVE_BINDADDR'}";#' config.inc.php
     perl -pi -e 's#(.*managesieve_usetls.*=).*#${1} false;#' config.inc.php
-    perl -pi -e 's#(.*managesieve_default.*=).*#${1} "$ENV{GLOBAL_SIEVE_FILE}";#' config.inc.php
+    perl -pi -e 's#(.*managesieve_default.*=).*#${1} "$ENV{DOVECOT_GLOBAL_SIEVE_FILE_SYMBOL}";#' config.inc.php
 
     echo 'export status_rcm_plugin_managesieve="DONE"' >> ${STATUS_FILE}
 }
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.