Prevent adding certain email names using the all_pre.sh script


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


Top Level » Email

Prevent adding certain email names using the all_pre.sh scriptLast Modified: Mar 31, 2008, 12:28 pm
If you wish to prevent users from adding email names like root, webmaster, postmaster, use the following code in your:
/usr/local/directadmin/scripts/custom/all_pre.sh
script:

#!/bin/sh

blockaccount()
{
   if [ "$user" = "$1" ] || [ "$newuser" = "$1" ]; then
      echo "You cannot create an account named $1";
      exit 1;
   fi
}

if [ "$command" = "/CMD_EMAIL_POP" ]; then
   if [ "$action" = "create" ] || [ "$action" = "modify" ]; then
      blockaccount root;
      blockaccount webmaster;
      blockaccount postmaster;
   fi
fi
exit 0;

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