LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-26-2005, 01:18 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Mail as Root?


For some reason I can't understand how this works or how to rid of this from my system.

My Linux server gets mail as root (seems to be system generated).

The location is shows from is /var/spool/mail/root": 112 messages 112 new

My question is how do I remove the email and how do I stop the email from coming?

Code:
>N  1 root@server.carlwill  Sat Feb 12 15:10  41/1325  "Invalid File Contexts"
 N  2 root@server.carlwill  Sun Feb 13 01:28 141/4050  "LogWatch for server.carlwill.com"
 N  3 root@server.carlwill  Mon Feb 14 04:02 133/5310  "LogWatch for server.carlwill.com"
 N  4 root@server.carlwill  Mon Feb 14 04:02  25/941   "Cron <root@server> run-parts /etc/cron.daily"
 N  5 root@server.carlwill  Tue Feb 15 04:02 206/9365  "LogWatch for server.carlwill.com"
The help menu says:

Code:
 Mail   Commands
t <message list>                type messages
n                               goto and type next message
e <message list>                edit messages
f <message list>                give head lines of messages
d <message list>                delete messages
s <message list> file           append messages to file
u <message list>                undelete messages
R <message list>                reply to message senders
r <message list>                reply to message senders and all recipients
pre <message list>              make messages go back to /usr/spool/mail
m <user list>                   mail to specific users
q                               quit, saving unresolved messages in mbox
x                               quit, do not remove system mailbox
h                               print out active message headers
!                               shell escape
cd [directory]                  chdir to directory or home if none given

A <message list> consists of integers, ranges of same, or user names separated
by spaces.  If omitted, Mail uses the last message typed.

A <user list> consists of user names or aliases separated by spaces.
Aliases are defined in .mailrc in your home directory.
What does the command look like to remove the mail? I can't figure this out...
 
Old 04-26-2005, 01:50 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Several of those messages are being generated by LogWatch, which is probably running from your cron.daily. Just go into /etc/cron.daily and move that Logwatch script to another place... maybe /root. I actually recommend having these emails delivered to a remote address.. maybe your regular mailbox. Just go into /etc/crontab and right near the top, you should see MAIL=root or something similar. Just change it to MAIL=you@yourdomain.com and these emails will be sent to an external mailbox. These logwatch reports are actually very good for seeing whats' happening on your system in a nice daily format. I don't recommend shutting these off completely. They could possibly alert you to hack attempts.
 
Old 04-26-2005, 01:51 PM   #3
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
I haven't read to much on mail but you can delete mail like this.

? d 1 2 3 4 5
?q

Some distros save it in $HOME/mail after its read I dont know how to set that up right now.
 
Old 04-26-2005, 01:56 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
So I will need to press

d 1 2 3 4 5 .... all the way to 120???

Is there a fast and quick way to delete them all or a bulk amount of them?
 
Old 04-26-2005, 02:09 PM   #5
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
Try d 1-120
 
Old 04-27-2005, 04:50 AM   #6
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
I suggest typing
Code:
rm /var/spool/mail/root
in a shell.

Groetjes,

Kees-Jan
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD--root has mail? Ha1f *BSD 6 11-12-2005 06:14 PM
/var/spool/mail/root mail message absalon Linux - General 1 07-04-2005 09:08 PM
How to get root mail? nepcw Linux - Newbie 16 03-29-2004 05:00 PM
receive root mail on other pc dARkHunTEr Linux - Networking 5 10-08-2003 01:33 PM
Reading Root Mail dvong3 Linux - General 10 07-17-2003 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration