aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server
blob: 96419f500a5cb5c30d101cf48b264b9a2bf39b1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -eu -o pipefail

PERCENT=$1
USER=$2
FROM=$3

cat << EOF | /usr/libexec/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=count:User quota:noenforcing"
From: ${FROM}
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