Files
server/usr/lib/plesk-9.0/send-quota-warning
2026-01-07 20:52:11 +01:00

31 lines
675 B
Bash
Executable File

#!/bin/sh
### Copyright 1999-2025. WebPros International GmbH. All rights reserved.
export PATH=/bin:/usr/bin
recipient="$1"
if [ -z "$recipient" ]; then
echo "User was not specified."
exit 1
fi
msg_path="/var/qmail/mailnames/.quotawarnmsg"
if [ ! -f "$msg_path" ]; then
echo "Unable to find warning report message '$msg_path'"
exit 1
fi
sender_domain="`hostname -f`"
sender="postmaster@$sender_domain"
date="`date --rfc-2822`"
plugin_rule="plugin/quota=maildir:User quota:noenforcing"
cat $msg_path | \
sed -e "s|@SENDER@|$sender|" \
-e "s|@RECIPIENT@|$recipient|" \
-e "s|@DATE@|$date|" \
| /usr/lib/dovecot/dovecot-lda -d $recipient -o "$plugin_rule"