vmail-stack/libexec/vmail-quota-warning.sh
Matthew Saunders Brown bef09f6e33 initial commit
2021-02-10 16:16:23 -08:00

13 lines
395 B
Bash

#!/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