[local/dovecot-user-add] ~correction champ from du courriel de bienvenu
[lhc/ateliers.git] / local / dovecot-user-add
index 017faaf..822a690 100755 (executable)
@@ -16,8 +16,8 @@ first_valid_gid=30000
 IFS=@ read -r user domain <<-EOF
        $1
        EOF
-test "${user:+set"}"
-test "${domain:+set"}"
+test "${user:+set}"
+test "${domain:+set}"
 shift
 
 # setup_nss
@@ -46,7 +46,7 @@ shift
        sudo chmod -t ~mail/acl/dovecot."$domain"
                # NOTE: permet les mv shared.db{.lock,} effectu├ęs par dovecot
        
-       sudo install -d -o mail -g php5_roundcube -m 1770 \
+       sudo install -d -o mail -g php_roundcube -m 1770 \
         /etc/dovecot/dovecot."$domain"
        sudo install -d -o mail -g postfix -m 750 \
         /etc/mail/dovecot
@@ -152,7 +152,7 @@ shift
                        extra_fields="${extra_fields:+$extra_fields }userdb_uid=$uid"
                        extra_fields="${extra_fields:+$extra_fields }userdb_gid=$gid"
                        extra_fields="${extra_fields:+$extra_fields }userdb_home=$home"
-                       extra_fields="${extra_fields:+$extra_fields }userdb_mail_access_groups=${mail_access_groups-$domain_group}"
+                       extra_fields="${extra_fields:+$extra_fields }userdb_mail_access_groups=${mail_access_groups-$domain_group,amavis}"
                        cat >&3 <<-EOF
                                $user:$password:$uid:$gid:$gecos:$home:$shell:$extra_fields
                                EOF
@@ -161,6 +161,8 @@ shift
                                sudo install -d -o "$uid" -g "$gid" -m 2770 \
                                 "$home" \
                                 "$home"/Maildir
+                               sudo install -d -o "$uid" -g "$gid" -m 2770 \
+                                "$home"/Maildir/.Trash
                                sudo install -d -o "$uid" -g "$gid" -m 0700 \
                                 "$home"/acl.d \
                                 "$home"/sieve.d
@@ -177,7 +179,7 @@ shift
                        if test "${welcome_mail:+set}"
                         then
                                mail \
-                                -S from=postmaster@"$local_domainname" \
+                                -postmaster@"$local_domainname" \
                                 -s "Bienvenue $user@$domain" \
                                 "$user"@"$domain" <<-EOF
                                        Bienvenue $user@$domain,
@@ -201,5 +203,5 @@ shift
                !!
                EOF
        sort -k 1,1 -t : |
-       sudo install -o php5_roundcube -g php5_roundcube -m 0640 /dev/stdin "$new_passwd"
+       sudo install -o php_roundcube -g php_roundcube -m 0640 /dev/stdin "$new_passwd"
        sudo mv -f "$new_passwd" "$old_passwd"