Source

iredmail / iRedMail / functions / dovecot2.sh

Diff from to

File iRedMail/functions/dovecot2.sh

 
 EOF
 
+    ECHO_DEBUG "Setting logrotate for dovecot log file."
     if [ X"${KERNEL_NAME}" == X'LINUX' ]; then
-        ECHO_DEBUG "Setting logrotate for dovecot log file."
         cat > ${DOVECOT_LOGROTATE_FILE} <<EOF
 ${CONF_MSG}
 ${DOVECOT_LOG_FILE} {
     endscript
 }
 EOF
-    else
-        :
+    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
+            cat >> /etc/newsyslog.conf <<EOF
+${DOVECOT_LOG_FILE}    ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME}   600  7     *    24    Z "doveadm log reopen"
+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 "doveadm log reopen"
+EOF
+        fi
     fi
 
     cat >> ${TIP_FILE} <<EOF