LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-02-2007, 11:55 AM   #1
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
Mail File Sizes and Truncating Them


Hey everyone!

My box (fc3) has sendmail (v8.x) installed and configured. My issue is that root gets about 405983495083 messages a day and his mailbox yields >100mb a week. It's now nearing a gig and I was wondering if it were possible to set up a cron to delete all his messages.

Now, I've gone into /var/spool/mail/ and replaced the mailbox file with a blank file - but that makes the mailbox not accessible from pine (not sure if it works still or not but it doesn't matter as I can't read those messages). Is there a command that I'm not aware of that can replace mailboxes with blank mailboxes?

Please feel free to give an alternate solution to the one I'm asking for as I'm not necessarily married to that idea.

Thanks!

Last edited by mcupples; 04-02-2007 at 11:56 AM.
 
Old 04-02-2007, 03:34 PM   #2
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
On the command line with root access type mail

It should show several messages. Type d *
This will delete all messages. Type x to quit.
 
Old 04-02-2007, 04:21 PM   #3
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
Thanks for your quick reply - but this appears to have only opened up new issues. I'm pretty sure that my mailbox is just too big. It's currently at ~700mb.

[root@db mcupples]# mail
d *Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 139232 messages 38639 new 139214 unread
fseek: Invalid argument
panic: temporary file seek
Segmentation fault
[root@db mcupples]#

The panic just worries me. I'm going to go google this and hopefully find something. Let me know if you think of anything first.

Thanks!
 
Old 04-02-2007, 04:53 PM   #4
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
If you simply rename the file to something else, will pine bomb out after that? It would basically be like deleting the file. When it needs to put another email in the file it will just recreate the file...
 
Old 04-03-2007, 08:49 AM   #5
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
I guess I just did it wrong yesterday. Strange. It works when I just "mv root rootytooty", just re-creates the root file. I guess I can delete rootytooty now.

As soon as I deleted it I had five new messages about mail failures. I think I've got to install that check root kit or something.
 
Old 04-03-2007, 08:54 AM   #6
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
I would check to make sure you didn't accidentally setup an open relay. Maybe a node inside your network has a virus and is using your server as it's relay......

Checking for a rootkit is not a bad idea either.

/var/log/maillog might help to find the origination point of these emails....
 
Old 04-03-2007, 08:59 AM   #7
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Original Poster
Rep: Reputation: 15
Much thanks for all your help. Looks like I have to do some work now.
 
  


Reply

Tags
box, mail, sendmail, size


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASAP! file and dir sizes omerdvd Linux - Newbie 1 12-10-2006 03:41 AM
LL and DU reporting different file sizes trewsfan Linux - General 5 07-20-2006 05:56 PM
sum total of file sizes allelopath Linux - General 3 01-07-2006 08:30 AM
reiserfs file sizes doralsoral Linux - Software 1 01-19-2005 03:52 PM
DVD File Sizes Maestro485 Linux - Software 1 12-21-2004 07:41 PM


All times are GMT -5. The time now is 06:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration