ISPconfig / dovecot – send mailbox quota warning to users

To alert users, that are approaching theirs mailbox quota limit you can use built in Dovecot plugin quota_warning.

1. Edit the main Dovecot configuration file:

plugin {
  quota = dict:user::file:/var/vmail/%d/%n/.quotausage

  # Do not change existing plugins defined above, just add new entries below

  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  quota_warning3 = -storage=100%% quota-warning below %u # user is no longer over quota

service quota-warning {
  executable = script /usr/local/bin/
  user = vmail
  unix_listener quota-warning {
        user = vmail
        mode = 0600

This will execute defined script /usr/local/bin/ when user will exceed 80 and 95% of their mailbox space.

2. Create the alerting script:

cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: postmaster@localhost.local
Subject: Mailbox size warning

Your mailbox is now $PERCENT% full. Please delete old messages.

You may edit the text to better explain required steps to resolve this issue.