Commits

Zhang Huangbin committed c242def

Dovecot will send an email to postmaster@ if user's mailbox is larger than or equal to 95% full.

Comments (0)

Files changed (3)

iRedMail/ChangeLog

 iRedMail-0.9.0:
+    * Dovecot will send an email to postmaster@ if user's mailbox is larger
+      than or equal to 95% full.
     * Drop support for below distributions and releases:
         + FreeBSD 8.x.
         + Ubuntu 10.04 (lucid). Please use 12.04 (precise) instead.

iRedMail/functions/amavisd.sh

 
 \$sql_allow_8bit_address = 1;
 \$timestamp_fmt_mysql = 1;
+
+# a string to prepend to Subject (for local recipients only) if mail could
+# not be decoded or checked entirely, e.g. due to password-protected archives
+#\$undecipherable_subject_tag = '***UNCHECKED*** ';  # undef disables it
+\$undecipherable_subject_tag = undef;
 EOF
 
     # Write dkim settings.
 EOF
     fi
 
+    # Don't send email with subject "UNCHECKED contents in mail FROM xxx".
+    if [ X"${AMAVISD_VERSION}" == X'2.7' ]; then
+        cat >> ${AMAVISD_CONF} <<EOF
+delete \$admin_maps_by_ccat{&CC_UNCHECKED};
+EOF
+    fi
+
     cat >> ${AMAVISD_CONF} <<EOF
 
 1;  # insure a defined return

iRedMail/samples/dovecot/dovecot2-quota-warning.sh

 # Use "plugin/quota=maildir:User quota:noenforcing" for maildir quota.
 cat << EOF | PH_DOVECOT_DELIVER -d ${USER} -o "plugin/quota=dict:User quota::noenforcing:proxy::quota"
 From: no-reply@PH_HOSTNAME
-Subject: Mailbox Quota Warning: ${PERCENT}% Full.
+Subject: Warning: Your mailbox is now ${PERCENT}% full.
+
+Your mailbox is now ${PERCENT}% full, please clean up some mails for further incoming mails.
+EOF
+
+# Send a copy to postmaster@ if mailbox is greater than or equal to 95% full.
+if [ ${PERCENT} -ge 95 ]; then
+    DOMAIN="$(echo ${USER} | awk -F'@' '{print $2}')"
+    cat << EOF | PH_DOVECOT_DELIVER -d postmaster@${DOMAIN} -o "plugin/quota=dict:User quota::noenforcing:proxy::quota"
+From: no-reply@PH_HOSTNAME
+Subject: Mailbox Quota Warning: ${PERCENT}% full, ${USER}
 
 Your mailbox is now ${PERCENT}% full, please clean up some mails for
 further incoming mails.
-
 EOF
+fi