Prevent a User from allowing more than 50MB of quota per E-Mail


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Email
Top Level » DirectAdmin » Custom Scripting

Prevent a User from allowing more than 50MB of quota per E-MailLast Modified: Mar 17, 2015, 2:54 pm
If you'd like to keep E-Mail quotas in check, you can prevent any User from setting a quota value higher than MB by creating this script:

cd /usr/local/directadmin/scripts/custom
nano email_create_pre.sh

and in that script, add this code:

#!/bin/sh
if [ "$quota" != "" ]; then
   if [ "$quota" -gt "50" ]; then
       echo "Cannot set quota greater than 50MB";
       exit 1;
   fi
fi
exit 0;

Then chmod the script to 755, and also create a link for the modification hook:

chmod 755 email_create_pre.sh
ln -s email_create_pre.sh email_change_pass_pre.sh


Test it out by both trying to create and also change an E-Mail account to have more than 50 Meg of quota.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST