[ale] clearing out root's mail

Björn Gustafsson bg-ale at bjorng.net
Wed Jan 6 13:26:47 EST 2010


No symlink, and the "1" means only one hard link, so that's not the
problem.  If the old messages are reappearing, the most likely culprit
is an email client which is holding the file open and then somehow
*moving it back* after you have clobbered it.  I am not aware of any
email client which is that aggressive.

The next thing to check is if there is a process holding the file
open.  That pretty much *has* to be the case, otherwise the old
messages would have disappeared.  Try `lsof /var/spool/mail/root' and
see what processes it reports, then consider killing those processes
if it seems appropriate.  If killing processes looks like it might
make sense, you first should follow Jim's advice and move the file to
another name before doing any killing.  Once there are no processes
attached, you should be able to delete the moved file and never see
those emails again.

Other than that, I can only think that some kind of special filesystem
attributes have been set on the file.  If you do `lsattr
/var/spool/mail/root' and see anything other than dashes, there might
be some setting like `a' that prevents the delete/clobber/truncate
from working (and a move *should* still work in that case as I
recall).  You can see the set of attributes in `man chattr' if you're
interested.

On Wed, Jan 6, 2010 at 1:11 PM, William Fragakis <william at fragakis.com> wrote:
> > When you say it "rebuilds", do the old messages also reappear?
>Yes. As fond as I was of 2008, there are some things I'd like to leave behind.
>
> does this help?
>
> # ls -l /var/spool/mail/root
> -rw------- 1 root root 64662366 Jan  6 09:59 /var/spool/mail/root
>
> thanks,
> William
>
>> On Wed, Jan 6, 2010 at 10:28 AM, William Fragakis <william at fragakis.com> wrote:
>> > I'm running Centos 5.4. Root's mail file has grown to a cumbersome size.
>> > I'd like to clear it out but if I follow the advice I've been able to
>> > googe and dum/delete/create new  the file (/var/spool/mail/root),
>> > sendmail rebuilds it to the original size.  Is there a step I'm missing?
>> >
>> > thanks,
>> > William


-- 
Björn Gustafsson



More information about the Ale mailing list