Commit 5e8cf0e2 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Remove all the spool files in /var/mail, not just root.

parent ca8fba0c
...@@ -18,7 +18,7 @@ my $FSTAB = "/etc/fstab"; ...@@ -18,7 +18,7 @@ my $FSTAB = "/etc/fstab";
my $LOGDIR = "/var/log"; my $LOGDIR = "/var/log";
my $RUNDIR = "/var/run"; my $RUNDIR = "/var/run";
my $HISTORY = "/root/.history"; my $HISTORY = "/root/.history";
my $MAILFILE = "/var/mail/root"; my $MAILDIR = "/var/mail";
my $LEASES = "/var/db/dhclient.leases"; my $LEASES = "/var/db/dhclient.leases";
my $NTPDRIFT = "/etc/ntp.drift"; my $NTPDRIFT = "/etc/ntp.drift";
my $SFSUSERS = "/etc/sfs/sfs_users"; my $SFSUSERS = "/etc/sfs/sfs_users";
...@@ -126,11 +126,8 @@ if (-f $HISTORY) { ...@@ -126,11 +126,8 @@ if (-f $HISTORY) {
die("Could not unlink $HISTORY: $!"); die("Could not unlink $HISTORY: $!");
} }
print "Removing root's mailfile ...\n"; print "Cleaning mail spool files ...\n";
if (-f $MAILFILE) { system("rm -rf $MAILDIR/*");
unlink($MAILFILE) or
die("Could not unlink $MAILFILE: $!");
}
# #
# Just removing the drift file results in no drift being tracked, # Just removing the drift file results in no drift being tracked,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment