Issue #526: Fix dovecot quota warnings
This commit is contained in:
parent
5eac4b375d
commit
1f932fd5ec
|
@ -300,8 +300,8 @@ plugin {
|
||||||
# Note that % needs to be escaped as %%, otherwise "% " expands to empty.
|
# Note that % needs to be escaped as %%, otherwise "% " expands to empty.
|
||||||
# quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
|
# quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
|
||||||
# quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
|
# quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
|
||||||
quota_warning = storage=95%% /usr/lib/alternc/quota-warning.sh 95
|
quota_warning = storage=95%% quota-warning 95 %u
|
||||||
quota_warning2 = storage=80%% /usr/lib/alternc/quota-warning.sh 80
|
quota_warning2 = storage=80%% quota-warning 80 %u
|
||||||
#quota = maildir
|
#quota = maildir
|
||||||
quota = dict:user::proxy::quotadict
|
quota = dict:user::proxy::quotadict
|
||||||
|
|
||||||
|
@ -317,6 +317,15 @@ plugin {
|
||||||
sieve_dir=~/sieve
|
sieve_dir=~/sieve
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service quota-warning {
|
||||||
|
executable = script /usr/lib/alternc/quota-warning.sh
|
||||||
|
unix_listener quota-warning {
|
||||||
|
mode = 0660
|
||||||
|
user = vmail
|
||||||
|
group = vmail
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Dictionary can be used by some plugins to store key=value lists, such as
|
# Dictionary can be used by some plugins to store key=value lists, such as
|
||||||
# quota, expire and acl plugins. The dictionary can be used either directly or
|
# quota, expire and acl plugins. The dictionary can be used either directly or
|
||||||
# though a dictionary server. The following dict block maps dictionary names to
|
# though a dictionary server. The following dict block maps dictionary names to
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PERCENT=$1
|
PERCENT="$1"
|
||||||
DOM="`echo $USER | sed -e 's/.*@//'`"
|
MAILUSER="$2"
|
||||||
|
DOM="$(echo "${MAILUSER}" | sed -e 's/.*@//')"
|
||||||
FROM="postmaster@$DOM"
|
FROM="postmaster@$DOM"
|
||||||
|
|
||||||
msg="From: $FROM
|
cat <<EOF | /usr/lib/dovecot/deliver -d "${MAILUSER}" -o "plugin/quota=maildir:User quota:noenforcing"
|
||||||
To: $USER
|
From: $FROM
|
||||||
|
To: $MAILUSER
|
||||||
Subject: Your email quota is $PERCENT% full
|
Subject: Your email quota is $PERCENT% full
|
||||||
Content-Type: text/plain; charset=UTF-8
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
|
||||||
Your mailbox is now $PERCENT% full."
|
Your mailbox is now $PERCENT% full."
|
||||||
|
|
||||||
echo -e "$msg" | /usr/sbin/sendmail -f $FROM "$USER"
|
EOF
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue