dear all i did have contact with support, and after testing i was unable to reacreate the problem with new accounts made form admin or resellers.
this really is strange i ended up creating a modified version of the rebuild /etc/virtual script on
http://help.directadmin.com/item.php?id=66
it is kinda quick and dirty, but purhaps its usefull to someone
in a sense you can verify your da /etc/virtual with files that should be there or not.
for me this helped a lot. still its strange why a lot of these file were not created.
(i did made this on freebsd i am aware of the == and = difference in the if statements in bash and sh not sure purhaps someone can test)
and i would not advise to use the -fixitnowsureyes if the default output does not make any sense
the syntax: sh checkdauser.sh [username|-all] [-fixitnowsureyes]
it does not print any output if all files are valid and ok.
the script has commented out the option of creating the quota and majordomo
on some test installations i did not use these options so these files were also not created for all users. uncomment to check these too.
there are two config parameters in the script
DAPATH="/usr/local/directadmin"
DAVIRT="/etc/virtual"
logical i assume
here it goes.
#!/bin/sh
# by: jan [ .,-a.t-,. ] makeitwork.nu
# version 1.1
################################################################
# config variables
DAPATH="/usr/local/directadmin"
DAVIRT="/etc/virtual"
################################################################
# Pointers
pexiu=0
# warning if you set this option it will allways try to fix things
FIXOPTION=0
################################################################
# arg 2 to fix or not
fixoption=$2
fixoption=`echo $fixoption | tr "[:upper:]" "[:lower:]"`
if [ ! "x$fixoption" = "x" ]
then
if [ ! "$fixoption" = "-fixitnowsureyes" ]
then
echo supply valid fix option
exit 2
else
FIXOPTION=7
fi
fi
# init userid variable
u=$1
if [ "x$u" = "x" ]
then
echo "syntax: checkdauser [username|-all] [-fixitnowsureyes]"
exit 1
fi
u=`echo $u | tr "[:upper:]" "[:lower:]"`
################################################################
#verify userid with DA
if [ "x$u" = "x-all" ]
then
pexiu=2
else
exiu=`ls $DAPATH/data/users | grep -i $u`
exiu=`echo $exiu | tr "[:upper:]" "[:lower:]"`
if [ "x$u" = "x" ]
then
pexiu=0
else
if [ "x$u" = "x$exiu" ]
then
pexiu=1
fi
fi
fi
if [ $pexiu -eq 0 ]
then
echo DA user $u does not exist.
exit 1
fi
################################################################
#functions
valdomown ()
{
valdo=`cat $DAVIRT/domainowners | grep -i $1`
valdo=`echo $valdo | tr "[:upper:]" "[:lower:]"`
if [ "x$valdo" = "x" ]
then
echo Missing for $u $1: $2 in domainowners
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $DAVIRT/domainowners with $1: $2
echo "$1: $2" >> $DAVIRT/domainowners
chown mail:mail $DAVIRT/domainowners
chmod 644 $DAVIRT/domainowners
fi
return 0
else
return 1
fi
}
valdom ()
{
valdom=`cat $DAVIRT/domains | grep -i $1`
valdom=`echo $valdom | tr "[:upper:]" "[:lower:]"`
if [ "x$valdom" = "x" ]
then
echo Missing for $u $1 in domains
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $DAVIRT/domains with $1
echo "$1" >> $DAVIRT/domains
chown mail:mail $DAVIRT/domains
chmod 644 $DAVIRT/domains
fi
return 0
else
return 1
fi
}
valdomfolfiles ()
{
if [ ! -f $1/aliases ]; then
echo missing $1/aliases
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/aliases with creating $1/aliases
echo "$u: $u" > $1/aliases
chown mail:mail $1/aliases
fi
fi
if [ ! -f $1/autoresponder.conf ]; then
echo missing $1/autoresponder.conf
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/autoresponder.conf with creating $1/autoresponder.conf
echo "" > $1/autoresponder.conf
chown mail:mail $1/autoresponder.conf
fi
fi
if [ ! -f $1/filter ]; then
echo missing $1/filter
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/filter with creating $1/filter
echo "" > $1/filter
chown mail:mail $1/filter
fi
fi
if [ ! -f $1/filter.conf ]; then
echo missing $1/filter.conf
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/filter with creating $1/filter.conf
echo "" > $1/filter.conf
chown mail:mail $1/filter.onf
fi
fi
if [ ! -f $1/passwd ]; then
echo missing $1/passwd
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/passwd with creating $1/passwd
echo "" > $1/passwd
chown mail:mail $1/passwd
fi
fi
#if [ ! -f $1/quota ]; then
#echo missing $1/quota
# if [ "x$FIXOPTION" = "x7" ]
# then
# echo FIXING: $1/quota with creating $1/quota
# echo "" > $1/quota
# chown mail:mail $1/quota
# fi
#fi
if [ ! -f $1/vacation.conf ]; then
echo missing $1/vacation.conf
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/vacation.conf with creating $1/vacation.conf
echo "" > $1/vacation.conf
chown mail:mail $1/vacation.conf
fi
fi
#if [ ! -d $1/majordomo ]; then
#echo missing Folder $1/majordomo
# if [ "x$FIXOPTION" = "x7" ]
# then
# echo FIXING: $1/majordomo with creating $1/majordomo
# mkdir $1/majordomo
# chmod 751 $1/majordomo
# chown majordomo:daemon $1/majordomo
# fi
#fi
if [ ! -d $1/reply ]; then
echo missing Folder $1/reply
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $1/reply with creating $1/reply
mkdir $1/reply
chmod 700 $1/reply
chown mail:mail $1/reply
fi
fi
}
valdomfol ()
{
valdomfol=`echo $1 | tr "[:upper:]" "[:lower:]"`
if [ ! -d $DAVIRT/$valdomfol ]
then
echo Missing for $u Folder $DAVIRT/$valdomfol
if [ "x$FIXOPTION" = "x7" ]
then
echo FIXING: $DAVIRT/$valdomfol with creating $DAVIRT/$valdomfol
mkdir $DAVIRT/$valdomfol
chmod 711 $DAVIRT/$valdomfol
chown mail:mail $DAVIRT/$valdomfol
valdomfolfiles $DAVIRT/$valdomfol
fi
else
valdomfolfiles $DAVIRT/$valdomfol
fi
}
valdompoint ()
{
if [ -f $DAPATH/data/users/$2/domains/$1.pointers ]
then
valdompoint=`cat $DAPATH/data/users/$2/domains/$1.pointers | grep -i $1`
valdompoint=`echo $valdompoint | tr "[:upper:]" "[:lower:]"`
if [ "x$valdopoint" = "x" ]
then
echo Missing for $u $1: $2 in domain pointers
return 0
else
return 1
fi
fi
}
################################################################
# gather domainnames
checkuser ()
{
if [ ! -f $DAPATH/data/users/$u/domains.list ]
then
echo $DAPATH/data/users/$u/domains.list Does not exist.
exit 1
fi
for d in `cat $DAPATH/data/users/$u/domains.list`; do
{
valdomown $d $u
valdom $d
valdomfol $d
#valdompoint $d $u
}
done;
}
################################################################
# Main loop
case "$pexiu" in
0 )
echo exit?
;;
1 )
checkuser
;;
2 )
for u in `ls $DAPATH/data/users`; do
{
checkuser
}
done;
;;
* )
echo how u ver got here?
;;
esac