SENDMAIL=/usr/sbin/sendmail # format of the quota file (quotaconf) # # you need to create a directory named "pquota" in the list directory # change the name/location of this directory in the sublimit.sh # shell script :0 * ? formail -rtzxTo: | multigram -b1 -m -l32500 quotaconf { SENDER=`formail -rtzxTo:` # check if the quota limit is exceeded QCHECK=`sublimit.sh $SENDER` :0 * -1^0 * $$QCHECK^0 { MAX=`grep -i $SENDER quotaconf | awk '{ print $3 }'` RANGE=`grep -i $SENDER quotaconf | awk '{ print $2 }'` SUBJECT="Max. Messages for this ${RANGE}: $MAX" :0 |(formail -rkbt -I"From: List Admin " \ -I"Subject: $SUBJECT" -i "X-Loop: $list@$domain"; \ cat postlimit.txt) | $SENDMAIL -t } }