summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xuser-init24
1 files changed, 12 insertions, 12 deletions
diff --git a/user-init b/user-init
index 5c26766..fb2def6 100755
--- a/user-init
+++ b/user-init
@@ -149,7 +149,7 @@ for user in $USERS; do
maildir="$MAILDIR"
if [ -f "$HOME/.procmailrc" ]; then
# Drop simple maildir-enabling procmail file when default
- if [ -n "$MAILDIR" ] && test "`md5sum \"$HOME/.procmailrc\" | awk '{print $1}'`" = "03ea802caaa5ce6f2a9be8d56eaf8ff5"; then
+ if [ -n "$MAILDIR" ] && [ "`md5sum \"$HOME/.procmailrc\" | awk '{print $1}'`" = "03ea802caaa5ce6f2a9be8d56eaf8ff5" ]; then
rm "$HOME/.procmailrc"
else
chown "$user": "$HOME/.procmailrc"
@@ -164,11 +164,6 @@ for user in $USERS; do
mkdir -p "$HOME/Maildir/cur" "$HOME/Maildir/new" "$HOME/Maildir/tmp"
chown -R "$user": "$HOME/Maildir"
chmod -R u=rw,go=,u+X "$HOME/Maildir"
- if [ -f "/var/mail/$user" ] && [ ! -s "/var/mail/$user" ]; then
- rm -f "/var/mail/$user"
- elif [ -f "/var/spool/mail/$user" ] && [ ! -s "/var/spool/mail/$user" ]; then
- rm -f "/var/spool/mail/$user"
- fi
else
mkdir -p "$HOME/mail"
if [ -n "$USE_MBOX" ]; then
@@ -183,12 +178,17 @@ for user in $USERS; do
chmod 0640 "$HOME/.mailboxlist"
fi
fi
- if [ -f "/var/mail/$user" ]; then
- chown "$user":mail "/var/mail/$user"
- chmod ug=rw,o= "/var/mail/$user"
- elif [ -f "/var/spool/mail/$user" ]; then
- chown "$user":mail "/var/spool/mail/$user"
- chmod ug=rw,o= "/var/spool/mail/$user"
+ mailspool="/var/spool/mail"
+ if [ -d "/var/mail" ]; then
+ mailspool="/var/mail"
+ fi
+ if [ -f "$mailspool/$user" ]; then
+ if [ -n "$maildir" ] && [ ! -s "$mailspool/$user" ]; then
+ rm "$mailspool/$user"
+ else
+ chown "$user":mail "$mailspool/$user"
+ chmod ug=rw,o= "$mailspool/$user"
+ fi
fi
if [ -f "$HOME/.forward" ]; then
chown "$user": "$HOME/.forward"