| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-02-2007, 11:55 AM
|
#1
|
|
Member
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57
Rep:
|
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.
|
|
|
|
04-02-2007, 03:34 PM
|
#2
|
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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.
|
|
|
|
04-02-2007, 04:21 PM
|
#3
|
|
Member
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57
Original Poster
Rep:
|
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!
|
|
|
|
04-02-2007, 04:53 PM
|
#4
|
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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...
|
|
|
|
04-03-2007, 08:49 AM
|
#5
|
|
Member
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57
Original Poster
Rep:
|
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.
|
|
|
|
04-03-2007, 08:54 AM
|
#6
|
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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....
|
|
|
|
04-03-2007, 08:59 AM
|
#7
|
|
Member
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57
Original Poster
Rep:
|
Much thanks for all your help. Looks like I have to do some work now. 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:57 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|