Add to Favourites Add to Favourites    Print this Article Print this Article

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

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.

Was this answer helpful?

Also Read