Commits

Zhang Huangbin  committed 378e7d7

Rotate Dovecot log files on FreeBSD.

  • Participants
  • Parent commits c82321d

Comments (0)

Files changed (2)

File iRedMail/ChangeLog

 iRedMail-0.8.2:
-    * Rotate Dovecot log files on OpenBSD.
+    * Rotate Dovecot log files on OpenBSD and FreeBSD.
     * Allow to use attribute domainGlobalAdmin for mail user.
     * Fixed:
         + Incorrect log rotate setting of iRedAPD log file on FreeBSD.

File iRedMail/functions/dovecot2.sh

     endscript
 }
 EOF
+    elif [ X"${KERNEL_NAME}" == X'FREEBSD' ]; then
+        if ! grep "${DOVECOT_LOG_FILE}" /etc/newsyslog.conf &>/dev/null; then
+            # Define command used to reopen log service after rotated
+            cat >> /etc/newsyslog.conf <<EOF
+${DOVECOT_LOG_FILE}    ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME}   600  7     *    24    Z    ${DOVECOT_MASTER_PID}
+EOF
+        fi
+
+        if ! grep "${SIEVE_LOG_FILE}" /etc/newsyslog.conf &>/dev/null; then
+            # Define command used to reopen log service after rotated
+            cat >> /etc/newsyslog.conf <<EOF
+${SIEVE_LOG_FILE}    ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME}   600  7     *    24    Z    ${DOVECOT_MASTER_PID}
+EOF
+        fi
+
     elif [ X"${KERNEL_NAME}" == X'OPENBSD' ]; then
         if ! grep "${DOVECOT_LOG_FILE}" /etc/newsyslog.conf &>/dev/null; then
             # Define command used to reopen log service after rotated