[Dovecot] quota warning script not working after upgrade to 2.1.1
With 2.0.18 I was using a quota warning script like this:
plugin { ...
Quota
quota = maildir quota_rule = INBOX.Trash:storage=+2048M quota_warning = storage=99%% quota-warning 99 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u }
der schickt die Quota warnmails
service quota-warning { executable = script /usr/local/scripts/quota-warning2.1 user = root unix_listener quota-warning { mode = 0666 user = vmail group = users } }
-rwxr-xr-x 1 root staff 3081 Feb 28 16:56 /usr/local/scripts/quota-warning2.1
But now I'm gettting this in my log: Feb 28 19:19:03 postamt quota-warning2(phxxxpsu): writing message failed Feb 28 19:19:03 postamt dovecot: quota-warning: Fatal: master: service(quota-warning): child 15065 returned error 1 Feb 28 19:40:13 postamt quota-warning2(lxxxve): writing message failed Feb 28 19:40:13 postamt dovecot: quota-warning: Fatal: master: service(quota-warning): child 3318 returned error 1
What is failing here?
#!/bin/sh
Should be run by the Local Delivery Agent
#set -x
SCRIPT_NAME="quota-warning2"
MAIL_TO=$2 MAIL_FROM="postmaster@charite.de" MAIL_QUOTA_PERCENT=$1 MAIL_SUBJECT="Ihre Mailbox ist zu "$1"% voll!"
BIN_CAT="/bin/cat" BIN_DATE="/bin/date" BIN_HOSTNAME="/bin/hostname" BIN_LOGGER="/usr/bin/logger" BIN_MV="/bin/mv" BIN_STAT="/usr/bin/stat"
#set -x
set misc values
HOSTNAME="${BIN_HOSTNAME}
"
set mail value
MAIL_DATE="${BIN_DATE} '+%a, %d %b %Y %T %z (%Z)'
"
MAIL_MESSAGE_ID="${BIN_DATE} '+%Y%m%d%H%M%S'
@${HOSTNAME}"
#To: ${MAIL_TO}
write out message
${BIN_CAT} << EOF | /usr/local/dovecot-2.1/libexec/dovecot/dovecot-lda -d $MAIL_TO -o "plugin/quota=maildir::noenforcing" From: ${MAIL_FROM} Subject: ${MAIL_SUBJECT} Message-Id: <${MAIL_MESSAGE_ID}> Date: ${MAIL_DATE} MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit
some warning in german
EOF
[ "$?" -gt 0 ] &&
${BIN_LOGGER} -p mail.error -t "${SCRIPT_NAME}(${MAIL_TO})"
"writing message failed" && exit 1
log warning attempt
${BIN_LOGGER} -p mail.info -t "${SCRIPT_NAME}(${MAIL_TO}) ${MAIL_QUOTA_PERCENT}%" "delivered!"
echo "${MAIL_DATE}: ${SCRIPT_NAME}(${MAIL_TO}) ${MAIL_QUOTA_PERCENT}% delivered!" >> /home/${SCRIPT_NAME}.log
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | http://www.charite.de
- Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>:
With 2.0.18 I was using a quota warning script like this:
Must have been a PEBKAC - I fixed my installation by harmonising $PREFIX (seperate $PREFIX for 2.0 and 2.1, removig an old installation along the way) as well as cleaning up some old scripts and alas:
Feb 28 22:13:15 postamt quota-warning2(lscxxxk) 90%: delivered! Feb 28 22:15:40 postamt quota-warning2(sxxxwart) 85%: delivered! Feb 28 22:17:39 postamt quota-warning2.1(sxxxwart) 90%: delivered! Feb 28 22:27:55 postamt quota-warning2.1(rxxxid) 85%: delivered!
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | http://www.charite.de
participants (1)
-
Ralf Hildebrandt