cancel
Showing results for 
Search instead for 
Did you mean: 

HP-UX mail file management

Ken Englander
Regular Advisor

HP-UX mail file management

Is there a way to compress wasted space out of a mail file. This is on HP-UX 11i v3. The root mail file unintentionally accumulated over 3,000 messages from batch jobs with no output file. I managed to delete the messages but I think the file is still much bigger than it needs to be.

Thanks!
5 REPLIES
Patrick Wallek
Honored Contributor

Re: HP-UX mail file management

Remove the file. It will be recreated if/when needed.
Ken Englander
Regular Advisor

Re: HP-UX mail file management

I cannot remove it - there are still messages in it. However, that is good to know - thanks!
Bill Hassell
Honored Contributor

Re: HP-UX mail file management

You can simply zero it out with:

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

If you need selected messages, running elm to browse through 3000 messages is quite fast and you can hold down the d key to delete the messages, about 10-20 per second. If you get to the end and discover some old messages you want to keep, just roll up/down and undo the deletion.


Bill Hassell, sysadmin
Ken Englander
Regular Advisor

Re: HP-UX mail file management

Apparently the remaining e-mails were a good deal bigger than I expected. I found out there were no e-mails needed so I was able to eliminate all of them and the files went back to 0.

I guess they automatically resize when e-mails are deleted - I just did not expect the e-mails were so big!

Thanks all!
Dennis Handly
Acclaimed Contributor

Re: HP-UX mail file management

You could use mailx to browse it. You can delete ranges with it.
from(1) will give you a list of subjects.