diff options
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-x | fripost-adduser | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/fripost-adduser b/fripost-adduser index 7971138..4b93a6f 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -6,21 +6,16 @@ use strict; =head1 NAME -fripost-adduser.pl - Add a new mailbox to the system +fripost-adduser - Add a new mailbox to the system =head1 DESCRIPTION -This script eases the burden of adding a new user to the system. - -Necessary steps to add a user to the system: -1. Create the Maildir (ensuring proper permissions) -2. Add him to the MySQL database -3. Send welcome message -4. Ensure welcome message has arrived +This script eases the burden of adding a new user to the system. It simply adds +a new user to the database. =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; use FindBin qw($Bin); use lib "$Bin/lib"; @@ -102,20 +97,6 @@ if ($conf->{pretend}) { exit 0; } -## Create maildir -my ($login,$pass,$uid,$gid) = getpwnam($conf->{maildir_user}) - or die "maildir_user not found: $conf->{maildir_user}"; - -my $maildir_loc = $conf->{maildir_base} . '/' . $user->{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}); - -say "Created maildir in $maildir_loc"; - ## TODO: Make sure the user does not already exist ## Insert user into database |