aboutsummaryrefslogtreecommitdiffstats
path: root/roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j2')
-rw-r--r--roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j219
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j2 b/roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j2
new file mode 100644
index 0000000..5ffe4b8
--- /dev/null
+++ b/roles/dovecot/templates/usr/local/bin/dovecot-quota-warning.sh.j2
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -Eeu -o pipefail
+
+PERCENT=$1
+USER=$2
+
+cat << EOF | /usr/libexec/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=count:User quota:noenforcing"
+From: postmaster@{{ dovecot_default_domain }}
+Subject: Mailbox quota warning
+
+This is an automatically generated message.
+
+Your mailbox is now ${PERCENT}% full.
+
+When your mailbox exceeds its quota, you will no longer receive new mail.
+
+Please delete some messages to free up space.
+EOF