--- smeserver-email-management-1.3/root/etc/e-smith/web/functions/user-email.ori 2016-08-08 08:42:00.000000000 -0400 +++ smeserver-email-management-1.3/root/etc/e-smith/web/functions/user-email 2017-05-29 13:58:53.753846928 -0400 @@ -269,7 +269,7 @@ if (db_get_type(\%accounts, $_) eq "pseudonym"); } - my $numAccts = @userAccounts; + my $numAccts = @userAccounts +1; if ($numAccts == 0) { print $q->h4 ('There are no user accounts in the system.'); @@ -310,6 +310,7 @@ my $fname = db_get_prop(\%accounts, $acct, "FirstName"); my $lname = db_get_prop(\%accounts, $acct, "LastName"); my $fullname = "$fname $lname"; + my $userpath = ($acct eq 'admin')? "": "files/users/$acct"; #clean display if ($EmailForward eq 'local') @@ -363,11 +364,11 @@ $tmda = db_get_prop(\%accounts, $acct, "tmda") || ''; if ($tmda eq "on") { - if (-e "/home/e-smith/files/users/$acct/.tmda/config") + if (-e "/home/e-smith/$userpath/.tmda/config") { $tmda = 'tmda'; } - elsif (-e "/home/e-smith/files/users/$acct/TMDA_restore.tgz") + elsif (-e "/home/e-smith/$userpath/TMDA_restore.tgz") { $tmda = 'tmda!'; } @@ -378,7 +379,7 @@ } else { - if (-e "/home/e-smith/files/users/$acct/.tmda/config") + if (-e "/home/e-smith/$userpath/.tmda/config") { $tmda = 'tmda*'; } @@ -386,7 +387,7 @@ } else { - if (-e "/home/e-smith/files/users/$acct/.tmda/config") + if (-e "/home/e-smith/$userpath/.tmda/config") { $tmda = 'tmda*'; } @@ -1131,9 +1132,10 @@ $acct = $acctName; } - if (db_get_type(\%accounts, $acct) eq "user") + if (db_get_type(\%accounts, $acct) eq "user" || $acct eq "admin") { my $name = db_get_prop(\%accounts, $acct, 'FirstName') . ' ' . db_get_prop(\%accounts, $acct, 'LastName'); + my $userpath = ($acct eq 'admin')? "": "files/users/$acct"; print $q->p ('Email delivery for the user account "' . $acct @@ -1198,7 +1200,7 @@ db_get_prop(\%accounts, $acct, "tmda") : ''; my $status = ''; - unless (-e "/home/e-smith/files/users/$acct/.tmda/config") + unless (-e "/home/e-smith/$userpath/.tmda/config") { $status = 'NOT'; } @@ -1407,10 +1409,10 @@ " \"\$SUBJECT\"\n\n". "will be read when I return.\n\n"; - if ( -e "/home/e-smith/files/users/$acct/.vacation.msg" ) + if ( -e "/home/e-smith/$userpath/.vacation.msg" ) { - open (VACATION, "; $vacationText = join ("", @vacationTemp); @@ -1602,6 +1604,8 @@ $acct = $1; } + my $userpath = ($acct eq 'admin')? "": "files/users/$acct"; + if ($Visible eq 'internal') { db_set_prop(\%accounts, $acct, 'Visible', $Visible); } else @@ -1655,7 +1659,7 @@ return; } - open (VACATION, ">/home/e-smith/files/users/$acct/.vacation.msg") + open (VACATION, ">/home/e-smith/$userpath/.vacation.msg") or die ("Error opening vacation message file '/home/e-smith/files/$acct/.vacation.msg': $!\n"); print VACATION "$vacationText"; @@ -1803,14 +1807,16 @@ $acct = $1; } - if (-f "/home/e-smith/files/users/$acct/$file") + my $userpath = ($acct eq 'admin')? "": "files/users/$acct"; + + if (-f "/home/e-smith/$userpath/$file") { - system("/bin/rm -f /home/e-smith/files/users/$acct/procmail.log"); + system("/bin/rm -f /home/e-smith/$userpath/procmail.log"); } - if (-f "/home/e-smith/files/users/$acct/$file") + if (-f "/home/e-smith/$userpath/$file") { - system("/bin/rm -f /home/e-smith/files/users/$acct/mailfilter.log"); + system("/bin/rm -f /home/e-smith/$userpath/mailfilter.log"); } showEnableProc ($q, "Deleted log file.", $acct); @@ -1831,9 +1837,11 @@ print $q->table ({border => 0, cellspacing => 0, cellpadding => 4}); - if ( -e "/home/e-smith/files/users/$acct/$file" ) + my $userpath = ($acct eq 'admin')? "": "files/users/$acct"; + + if ( -e "/home/e-smith$userpath/$file" ) { - open (INF,"/home/e-smith/files/users/$acct/$file") + open (INF,"/home/e-smith/$userpath/$file") or die ("can't open $file to read: $1. "); while ()