diff -up smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-procmail.patch3 smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-procmail --- smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-procmail.patch3 2006-02-09 23:19:25.000000000 -0500 +++ smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-procmail 2013-05-13 22:08:28.000000000 -0400 @@ -31,8 +31,8 @@ if ( $Hlp ) { &PrintPod(9); exit; } # Check for e-smith-user-panel my $UPanel=`rpm -qa | grep -c "smeserver-userpanel"`; if ( $UPanel < 1 ) { - print "\nThis tool requires the smeserver-userpanel contribution from Dungog Networks.\n"; - print "Please download it from http://dungog.net and install it first.\n\n\a"; + print "\nThis tool requires the smeserver-userpanel and smeserver-mailsorting contribution.\n"; + print "Please download them with yum from smecontribs repo and configure them first.\n\n\a"; exit; } @@ -73,7 +73,7 @@ foreach my $record (@records) print "Activating procmail for user '$username'.\n"; db_set(\%processmail, $username, 'settings', \%user); db_set_prop(\%accounts, $username, 'EmailForward', 'procmail'); - system("/sbin/e-smith/signal-event", "user-modprocmail", $username) == 0 + system("/sbin/e-smith/signal-event", "email-update-quick", $username) == 0 or die ("An error occurred while updating account '$username'.\n"); } } @@ -81,7 +81,7 @@ foreach my $record (@records) print "Deactivating procmail for user '$username'.\n"; db_delete(\%processmail, $username, 'settings', \%user); db_set_prop(\%accounts, $username, 'EmailForward', 'local'); - system("/sbin/e-smith/signal-event", "user-modprocmail", $username) == 0 + system("/sbin/e-smith/signal-event", "email-update-quick", $username) == 0 or die ("An error occurred while updating account '$username'.\n"); } } diff -up smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-users.patch3 smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-users --- smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-users.patch3 2013-05-13 22:05:14.000000000 -0400 +++ smeserver-lazy_admin_tools-1.0/root/usr/sbin/lat-users 2013-06-19 00:28:33.000000000 -0400 @@ -18,6 +18,7 @@ tie %accounts, 'esmith::config', '/home/ my ($Hlp, $Cml, $Frc, $Inp, $Pwf); my $Add =0; my $Del =0; +my $Kaa =0; my $passwlist="./passwords.new"; #============================================================================== @@ -28,7 +29,8 @@ GetOptions ("help" => \$Hlp, "add" => \$Add, "delete" => \$Del, "force" => \$Frc, - "passwords" => \$Pwf, + "nickname" => \$Kaa, + "passwords" => \$Pwf, "command-line=s" => \$Cml, "input-file=s" => \$Inp); @@ -116,6 +118,12 @@ if ($Add) { system("/usr/sbin/lat-groups -a -c='$fields[$cntgrps]|$fields[$cntgrps]||$username'"); } } + if ($Kaa) { + + print "creating SME default pseudonyms\a\n"; + system("/usr/sbin/lat-pseudonyms -a -c='$username|".$user{"FirstName"}.".".$user{"LastName"}."|".$user{"FirstName"}."_".$user{"LastName"}."'"); + + } } } else { print "User '$username' is not a correct username.\a\n"; } @@ -136,18 +144,24 @@ if ($Del) { if ((db_get(\%accounts, $username)) && (db_get_type(\%accounts, $username) eq "user")) { my $yn = 'yes'; - if (! $Frc) { - print "Do you want to delete user '$username'?\n"; - print "All files belonging to this user account will be deleted! [yes/NO/all] "; - $yn = ; - if ($yn =~ /^a/i) { $Frc = -1; $yn="yes"; } - } - if ($yn =~ /^y/i) { - print "Deleting user account '$username'.\n"; - db_delete(\%accounts, $username); - system("/sbin/e-smith/signal-event", "user-delete", $username); - system("/usr/sbin/lat-groups -r -f -c='*|$username'"); - } + my $userdir = `cat /etc/passwd|grep "^$username:"|cut -d":" -f6`; + print "$userdir\n"; + if ( $userdir eq "/home/e-smith/files/users/$username" ) + { + if (! $Frc) { + print "Do you want to delete user '$username'?\n"; + print "All files belonging to this user account will be deleted! [yes/NO/all] "; + $yn = ; + if ($yn =~ /^a/i) { $Frc = -1; $yn="yes"; } + } + if ($yn =~ /^y/i) { + print "Deleting user account '$username'.\n"; + db_delete(\%accounts, $username); + system("/sbin/e-smith/signal-event", "user-delete", $username); + system("/usr/sbin/lat-groups -r -f -c='*|$username'"); + } + } + else { print "'$username' is not a regular SME user with its home in /home/e-smith/files/users/, can not remove it\n\a";} } else { print "Can't find user '$username'.\n\a";} }