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

I want to customize the daily User email limit files based on a custom package item

With the addition of the custom package items, you can now use these items to control other areas of your system.  For this example, we'll have these items control the daily email limit of a User (/etc/virtual/limit_username).

1)The first step is to add a custom package item.  See this guide on how to do that.  For this example, use a 'text' value.  Give the variable a name called user_email_limit

2)Next, we need to have this option do something.  By default, the item is only stored in the user.conf file.. it won't do anything.
To have it do something, create the script /usr/local/directadmin/scripts/custom/   Inside that file, add this code:

if [ "$user_email_limit" != "" ] && [[ $user_email_limit =~ ^-?[0-9]+$ ]] && [ "$user_email_limit" -gt 0 ]; then
    echo -n "$user_email_limit" > /etc/virtual/limit_$username
exit 0;

Once the User is created, this package variable will no longer have any effect, meaning changing it from the package won't have any effect (you can if you want by creating a similar
The way to change the per-User email limit setting would be normally through:

Reseller Level -> List Users -> Username -> E-Mail Limit

Was this answer helpful?

Also Read