vmail-stack/libexec/vmail-quota-warning.sh

13 lines
395 B
Bash
Raw Normal View History

2021-02-10 16:16:23 -08:00
#!/bin/bash
PERCENT=$1
USER=$2
DOMAIN=${USER##*@}
if [ "$PERCENT" -eq '95' ] ; then
MSG="Your mailbox is now $PERCENT% full. Please delete some messages immediately to avoid email service interruptions."
else
MSG="Your mailbox is now $PERCENT% full. Please delete some messages to avoid exceeding your quota."
fi
echo "$MSG" | mail -s "Email quota warning" $USER -aFrom:postmaster@$DOMAIN