2

The root mail account has been blown up by mischieveous cronjobs, and I want to completely delete the mail from the account. Is there a key for that in the mail command?

I deleted /var/mail/root but I don't know if that's the proper way to do it, or if the root file needs to be recreated manually.

Update I recreated the root file with 660 and root:mail ownership, I'll see if this is needed to let the root account get mail again.

1 Answer 1

5

The accepted method is:

cat /dev/null > /var/spool/mail/root

Your method should have worked, but you might need to restart sendmail (or whatever) as it might have choked on the brief lack of file.

3
  • I should have noted my platform: I'm on Solaris 9 atm and /var/spool/mail/ doesn't exist in this environment. That said, restarting sendmail fixed the issue. Jun 30, 2010 at 21:11
  • @Luke has no name: It's still /var/spool/something iirc, and you can still cat /dev/null. That basically does the same thing as deleting the file, but it preserves the file with all of it's permissions, etc. Jul 1, 2010 at 0:27
  • Or just > /var/spool/something/blah
    – Allen
    Jul 4, 2010 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .