aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-adduser
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2011-01-05 15:50:16 +0100
committerStefan Kangas <stefankangas@gmail.com>2011-01-05 15:50:16 +0100
commit3cfc25a53829c3121e7ca8190bc8de72e3d7f051 (patch)
tree61fe0143b2d1e8eba1fb7a1e8813b37c6d69bada /fripost-adduser
parent8528efc6b533dd72ee11a6e95c7b09f10752a405 (diff)
Fix bugs in adduser
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-xfripost-adduser5
1 files changed, 3 insertions, 2 deletions
diff --git a/fripost-adduser b/fripost-adduser
index 1dab56e..f153e67 100755
--- a/fripost-adduser
+++ b/fripost-adduser
@@ -52,7 +52,7 @@ sub read_user_info {
$user{domain} = $domain;
# Construct maildir from domain and user
- $user{maildir} = "$domain/$username/Maildir";
+ $user{maildir} = "$domain/$username/Maildir/"; # trailing slash important
# Set dates
my $now = DateTime->now(
@@ -117,7 +117,8 @@ my ($login,$pass,$uid,$gid) = getpwnam($conf->{maildir_user})
my $maildir_loc = $conf->{maildir_base} . '/' . $user->{maildir};
-system(qw/sudo mkdir -p -m/, $conf->{maildir_umask}, $maildir_loc =~ m!(.+)/Maildir$!);
+$maildir_loc =~ m!(.+)/Maildir/$!;
+system(qw/sudo mkdir -p -m/, $conf->{maildir_umask}, $1);
system(qw/sudo maildirmake/, $maildir_loc);
system(qw/sudo chmod/, $conf->{maildir_umask}, $maildir_loc);
system(qw/sudo chown -R/, "$conf->{maildir_user}:$conf->{maildir_group}", $conf->{maildir_base});