Prevent adding certain email names using the all_pre.sh script

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;


Was this article helpful?

mood_bad Dislike 2
mood Like 0
visibility Views: 11328