plugin {
quota_rule = *:storage=10M
quota = maildir:User quota
quota_rule2 = Junk:ignore
quota_rule3 = Trash:storage=+100M
quota_warning = storage=50%% quota-warning 50 %u
quota_exceeded = storage=100%% quota-exceeded 100 %u
}
plugin {
quota_warning = storage=50%% quota-warning 50 %u
quota_exceeded = storage=100%% quota-exceeded 100 %u
}
service quota-warning {
executable = script /root/bin/quota-warning.sh
user = root
unix_listener quota-warning {
user = vmail
mode = 0666
}
}
service quota-exceeded {
executable = script /root/bin/quota-exceeded.sh
user = root
unix_listener quota-exceeded {
user = vmail
mode = 0666
}
}
I sent an email with 8Mb (limit is 10Mb) but quota-warning executed when I delete that message (moved it to trash) instead of quota-exceeded being executed.
cat /root/bin/quota-warning.sh
touch /tmp/quota-warning-executed
cat /root/bin/quota-exceeded.sh
touch /tmp/quota-exceeded-executed
You have to configure quota exclusion for
Junk
folder and overhead forTrash
:As stated by
dovecot
wiki, to avoid quota warning on moving toTrash
,That is intended because moving to the
Trash
is the two-step procedure (copying + removing). For the short time you have two copies of the same message and both of them are counted by quota plugin. IfTrash
have some overhead then freshly copied message do not exceed the main limit. Refer to the dovecot's wiki for further information: https://wiki.dovecot.org/Quota