satankoh666
Verified User
- Joined
- Feb 2, 2020
- Messages
- 17
Hi experts
I follow this post: https://help.directadmin.com/item.php?id=625 to add a quota limit notification where the system will send out notification email to users when their email hit 80%, 90% and 100% of their quota, and it works like a charm.
However, is there a way that I can tweak the script to ALSO send an notification to a specific email like the admin email?
This is the steps that i followed:
cd /etc/dovecot/conf.d
wget -O 91-quota-warning.conf http://files1.directadmin.com/services/all/91-quota-warning.conf
wget -O /usr/local/bin/quota-warning.sh http://files1.directadmin.com/services/all/quota-warning.sh
chmod 755 /usr/local/bin/quota-warning.sh
This is the script in the quota-warning.sh
#!/bin/bash
PERCENT=$1
USER=$2
DOMAIN=$3
FROM=$USER
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <percent> <email> <domain>";
exit 1;
fi
cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: $FROM
Subject: Email Quota Usage: $PERCENT%
This is an automated notification letting you know that your account:
$USER
has used $PERCENT% of it's available space.
EOF
Thanks in advanced
Ron
I follow this post: https://help.directadmin.com/item.php?id=625 to add a quota limit notification where the system will send out notification email to users when their email hit 80%, 90% and 100% of their quota, and it works like a charm.
However, is there a way that I can tweak the script to ALSO send an notification to a specific email like the admin email?
This is the steps that i followed:
cd /etc/dovecot/conf.d
wget -O 91-quota-warning.conf http://files1.directadmin.com/services/all/91-quota-warning.conf
wget -O /usr/local/bin/quota-warning.sh http://files1.directadmin.com/services/all/quota-warning.sh
chmod 755 /usr/local/bin/quota-warning.sh
This is the script in the quota-warning.sh
#!/bin/bash
PERCENT=$1
USER=$2
DOMAIN=$3
FROM=$USER
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <percent> <email> <domain>";
exit 1;
fi
cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: $FROM
Subject: Email Quota Usage: $PERCENT%
This is an automated notification letting you know that your account:
$USER
has used $PERCENT% of it's available space.
EOF
Thanks in advanced
Ron