I would like to run a custom script with dovecot once the user reaches certain percents of their quota.
The issue is that no matter what I try dovecot does not seem to execute my bash script.
90-quota.conf
plugin {
quota_warning = storage=95%% quota-warning 95 %u
quota_warning2 = storage=10%% quota-warning 10 %u
}
service quota-warning {
executable = script /var/www/lighttpd/mail/scripts/quotaWarning.sh
user = root
unix_listener quota-warning {
user = dovecot
mode = 0666
}
}
I have tried it with & without the user/mode/group arguments. I have also tried root/mail/dovecot users in all the different variations but with no luck at all.
quotaWarning.sh
#!/bin/sh
PERCENT="${1}"
USER="${2}"
cat <<EOF | /usr/libexec/dovecot/deliver -d mailbox@domain.tld -c /etc/dovecot/dovecot.conf
From: noreply@domain.co.za
Subject: Mailbox Quota Warning: ${PERCENT}% Full.
Mailbox quota report:
${USER}
* Your mailbox is now ${PERCENT}% full, please clear some files for further mails.
EOF
- The scripts permissions are set to 777 & I have has it with both user & groups of root & dovecot.
- Dovecot version is 2.2.7
- I am running CentOS 6.5 64bit
- Kernel: 2.6.32-042stab078.26
Any assistance would be awesome since I am now at a loss.