create-user: Make .domtool symlink with correct ownership
[hcoop/scripts.git] / create-user
index 15ce41a..ce6304f 100755 (executable)
@@ -194,7 +194,7 @@ mkdir -p $HOMEPATH/.public/.domtool
 chown $USER:nogroup $HOMEPATH/.public/.domtool
 test -e $HOMEPATH/.domtool || \
     test -L $HOMEPATH/.domtool || \
-        ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
+        sudo -u $USER ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
 
 # Gitweb hosting
 test -L /var/cache/git/$USER || \
@@ -219,6 +219,7 @@ if test ! -e $MAILPATH/new; then
             -e -a "From: postmaster@hcoop.net" \
             real-$USER
 fi
+chown $USER:nogroup $MAILPATH/cur $MAILPATH/new $MAILPATH/tmp
 
 # Set up shared SpamAssassin folder
 if test -f $HOMEPATH/Maildir/shared-maildirs; then