Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cleaning out mailboxes. New to sendmail 1

Status
Not open for further replies.

van0014

IS-IT--Management
Feb 9, 2002
2
US
I am running sendmail on a linux server. I have aboute 100 employees. There are a few who never check their email. What I am asking is how do I verify the boxes that are filling up and how do I clean out the boxes? I do not want to delete the user.
Thanks
 
One way would be to just check the /var/spool/mail directory (or other mail spooling directory you may be using instead...). The mail sits in the spool until the user 'checks' his/her mail, at which time their mail client copies the mail from the spool to the users home directory.

For instance:
bash-2.05# ls -l /var/mail
total 1
-rw------- 1 user1 wheel 0 Feb 7 10:09 user1
-rw------- 1 user2 users 435 Jan 21 11:53 user2
-rw------- 1 root wheel 0 Feb 9 04:56 root

(You'll probably need to be root to do this.)

Here user1 and root check their mail. user2 doesn't. [This is from a NetBSD box; my Linux box at home uses /var/spool/mail instead of /var/mail]

So you can delete the spool files for users with big spool files who never check their mail. The spool file should be recreated automatically if/when they receive more mail. (just tried it on NetBSD and it did)
 
Thank you DumTech. Very helpful. I FTPd into the server and went to the directory you were talking about. The problem is that the date that is in the spool is the date of the last posted email to that account. Because we send out broadcast messages just about every day almost all had the same date. I could easily pick a couple out due to the fact that there was over 6M of email data. Not sure about the rest.
This info though will help with the really large email directories.
Walladog
 
Glad it helped a little.

You're right about the date, but as you said the directory listing will at least give some indication of who rarely checks their mail by looking at the size of their inbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top