X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=local%2Fdovecot-user-add;h=822a690afbdf36740e6c3ded575045395c9ace6a;hp=017faaf2ef02da509733fbe925aa0fdd25e516a9;hb=HEAD;hpb=b75d4503ef9c919231c0c02daf5a1ed1e57c73af diff --git a/local/dovecot-user-add b/local/dovecot-user-add index 017faaf..822a690 100755 --- a/local/dovecot-user-add +++ b/local/dovecot-user-add @@ -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" \ + -r 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"