new-user: chown the .forward file after creating it.
[clinton/scripts.git] / new-user
index 79cf96e..8f015ed 100755 (executable)
--- a/new-user
+++ b/new-user
@@ -2,7 +2,7 @@
 
 USERNM=$1
 REALNM=$2
 
 USERNM=$1
 REALNM=$2
-EMAILADDR=$4
+EMAILADDR=$3
 PWFILE=/var/lib/portal/$USERNM
 
 if test -z "$USERNM"; then 
 PWFILE=/var/lib/portal/$USERNM
 
 if test -z "$USERNM"; then 
@@ -60,6 +60,7 @@ else
        echo setting email forward to "$EMAILADDR"
        sh -c "echo '$EMAILADDR' > ~$USERNM/.public/.forward" || \
        ( echo "Failed to set forward address" && exit 6 )
        echo setting email forward to "$EMAILADDR"
        sh -c "echo '$EMAILADDR' > ~$USERNM/.public/.forward" || \
        ( echo "Failed to set forward address" && exit 6 )
+       chown $USERNM ~$USERNM/.public/.forward
 fi
 
 #
 fi
 
 #