/var/spool/mail/<username> files' content wipeout impact

Hi Guys!!!

->I am using AIX 6.1. One of the file system full which is /var filesystem.
->/var total size is 5.00 GB.
->And inside the /var file system spool/mail folde is taking around 2.9 GB.
->There 3 big size of file as shown below, which shows that these files are taking more size.
-rw-rw---- 1 XXXX mail 34038198 Jun 19 17:00 XXXX
-rw-rw---- 1 root mail 2035034669 Jun 19 17:05 root
-rw-rw---- 1 oracle mail 906850628 Jun 19 17:05 oracle

->I checked on the internet and noticed that we can these files empty.
->Please advice if I'll make these 3 files to zero.
->before making these 3 files to zero, how can I know these files having critical taxt or not.
->Actually, I am scaring :(if I will wipeout its content then how much it it will either critical or no impact.

-> Kindly advice.

Have a read of the manual pages for the mail command. Whilst you can just remove the files, these are likely diagnostic messages that you should read.

If you have cron jobs and they create output or errors that would go to the screen, these are mailed to the id running the command. Other things that might go are automated diagnostics, hardware alerts, full disk alerts etc.

Sign on as the id owning the mailbox and run the command mail with no parameters to read the mail.

2Gb of text only email for root is a lot. You need to find out why you are getting it. Similarly, oracle having 900Mb is vast, so something it wrong.

Robin

My two cents with rbattel, those are unread messages, figure out why it is generating it, by logging in as that user and running mail (as mentioned by rbattel).

Also, check your cron, see if you are missing > /dev/null 2>&1 for jobs.

Also check if you have the correct smtp server name in /etc/sendmail.cf file

cat /etc/sendmail.cf | grep DS
Does it show you, your local smtp server name?

If it does not then add the server name and restart the sendmail service.

lssrc -s sendmail, if its not then start it
startsrc -s sendmail -a "-bd -q30"
2 Likes

Just adding > /dev/null 2>&1 to cron job definitions doesn't mean that an actual problem is fixed, (if there is one) but you may stop further messages.

I forgot that failed sending to external email will generate failure return reports for the sender.

What do you see in the mail for these users? Can you paste (in CODE tags) a sample?

Robin

Amen to what ibmtech and rbatte1 said, they are correct.

In principle it is the duty of the admin to read such messages. Having said this: reading several GB of text messages might take you longer than your active job life and i bet the first of these messages are from a time computers ran on steadm, not on electric power.

Therefore i suggest you: delete the mail file for "XXXX". This is an ordinary user and he should have checked his mail when he had the opportunity. This gives you some free space back.

Second, log on as root and open the mail. Delete all messages save for the last 100 or so and read these. Perhaps there is a pattern to them and what you have deleted is either outdated or repetition of this pattern anyway.

Do the same for the Oracle user. See the man page of "mail" on how to delete a range of messages. It will tell you how many messages there are in the inbox, so you can calculate how many you can delete. Note that they are sorted chronologically with the newest messages holding the highest numbers.

From now on you should read the mails to root and other system users daily. Either these messages are important and will help you better administer the system OR they are superfluous and you should switch their generation off at the source.

On a second thought: if you do not check the mail regularly you probably do not trim /var/adm/wtmp either. You might have a look at it and maybe trim it. DO NOT delete it! "zap" the file:

cat /dev/null > /var/adm/wtmp

I hope this helps.

bakunin

1 Like