self-hosting/roles/mailserver_dovecot/files/quota-warning.sh

15 lines
420 B
Bash
Raw Normal View History

2024-01-09 19:25:44 +01:00
#!/bin/sh
PERCENT=$1
USER=$2
2024-11-01 16:42:54 +01:00
DOMAIN=$(echo "$2" | awk -F@ '{print $2}')
2024-01-09 19:25:44 +01:00
cat << EOF | /usr/lib/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=maildir:User quota:noenforcing"
2024-11-01 16:42:54 +01:00
From: postmaster@$DOMAIN
2024-01-09 19:25:44 +01:00
Subject: Quota warning - $PERCENT% reached
Your mailbox can only store a limited amount of emails.
Currently it is $PERCENT% full. If you reach 100% then
new emails cannot be stored. Thanks for your understanding.
EOF