add quota warnings
This commit is contained in:
parent
202f9bdb4c
commit
35f5fbb65a
3 changed files with 35 additions and 0 deletions
10
files/quota-warning.sh
Normal file
10
files/quota-warning.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
PERCENT=$1
|
||||
USER=$2
|
||||
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
|
||||
From: postmaster@cccv.de
|
||||
Subject: Quota warning
|
||||
|
||||
Your mailbox is now $PERCENT% full.
|
||||
Please consider archiving larger files in Nextcloud - a mail server is not a document archive.
|
||||
EOF
|
||||
|
|
@ -30,6 +30,15 @@
|
|||
group: vmail
|
||||
mode: '0750'
|
||||
|
||||
- name: Create quota warning script
|
||||
copy:
|
||||
src: quota-warning.sh
|
||||
dest: /usr/local/bin/quota-warning.sh
|
||||
owner: vmail
|
||||
group: vmail
|
||||
mode: '554'
|
||||
when: dovecot.quota
|
||||
|
||||
- name: copy dovecot config
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
|
|
|
|||
|
|
@ -109,4 +109,20 @@ service quota-status {
|
|||
}
|
||||
client_limit = 1
|
||||
}
|
||||
|
||||
plugin {
|
||||
quota_warning = storage=10%% quota-warning 10 %u
|
||||
quota_warning2 = storage=80%% quota-warning 80 %u
|
||||
}
|
||||
|
||||
service quota-warning {
|
||||
executable = script /usr/local/bin/quota-warning.sh
|
||||
# use some unprivileged user for executing the quota warnings
|
||||
user = vmail
|
||||
unix_listener quota-warning {
|
||||
user = vmail
|
||||
group = vmail
|
||||
}
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue