#存放邮箱文件的目录
ACCESS=access.db
#用于临时存放超过门限值的邮箱名
SUBACCESS=access.sub
#用于存放额外的收、转发限制规则
if [ $# -lt 1 ]; then
error "Must set the MAX mailbox size with the command!"
fi
if [ $1 -le 0 ] ; then
error " Mailbox Size < 0, Failed"
fi
((MAXSIZE=$1*1024*1024))
if [ -f $MAIL/$SUBACCESS ]; then
$BIN/cat $MAIL/$SUBACCESS > $MAIL/$ACCESS ' '
error "piping $MAIL/$SUBACCESS into $MAIL/$ACCESS, Failed"
else
> $MAIL/$ACCESS' 'error "clearing $MAIL/$ACCESS, Failed"
fi
cd $MAILDIR' 'error "entering $MAILDIR Failed"
for box in '$BIN/find .
! -user root -size +"$MAXSIZE"c -type f -print'; do
case $box in
.|..|./.*.pop)
;;
*)
mailuser=${box#./}
echo "To:$mailuser@
ERROR:550 $mailuser's Mailbox is full " >> $MAIL/$ACCESS
;;
esac
done
cd $MAIL || error " entering $MAIL Failed"
/usr/sbin/makemap dbm access
< ./$ACCESS || error "makemaping access Failed"
exit 0'