LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2014, 12:14 AM   #1
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Rep: Reputation: 16
How to view mail sent to root@localhost in Ubuntu Precise?


I'm running Ubuntu Precise (12.04) and /etc/mail is not listed as a directory, but there is a /etc/alternatives/mail folder that is empty. The problem is that I installed a couple of programs that send logs to root@localhost and I want to be able to view it. I installed mailutils with apt-get but still no luck. Do I need to set-up Postfix in order to view mail sent to root@localhost? And if not then what should I do?
 
Old 06-26-2014, 12:39 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,472

Rep: Reputation: 189Reputation: 189
Mail is usually stored at /var/mail/<username>. If mail is being delivered to root, you should see a file named "root" in /var/mail. To read it install "mutt"($ sudo apt-get install mutt). To read root's mail, open a console and run:

$ sudo mutt

If that doesn't work and assuming there is a /var/mail/root, file, then try:

$ sudo mutt -f /var/mail/root
 
1 members found this post helpful.
Old 06-26-2014, 12:58 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Arrow

Quote:
Originally Posted by kilgoretrout View Post
Mail is usually stored at /var/mail/<username>. If mail is being delivered to root, you should see a file named "root" in /var/mail. To read it install "mutt"($ sudo apt-get install mutt). To read root's mail, open a console and run:

$ sudo mutt

If that doesn't work and assuming there is a /var/mail/root, file, then try:

$ sudo mutt -f /var/mail/root
Code:
Should be able to just 
cd /var/mail/root
ls
sudo cat /var/mail/root/<message>
 
Old 06-26-2014, 01:50 AM   #4
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
Thanks kilgoretrout mutt is a very interesting little program I set up mails for the two user accounts on my system in the /var/mail/ directory but when I try to send mail I get an error. To send mail I do:
Code:
mutt -s "Welcome Msg" willz@localhost < email_body.txt
but I get this error:
Code:
sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Error sending message, child exited 75 (Deferred.).
Could not send the message.
Does that mean that I cannot send or receive messages unless I install postfix?

Last edited by judoka; 06-26-2014 at 02:32 AM.
 
Old 06-26-2014, 10:20 AM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,472

Rep: Reputation: 189Reputation: 189
You need to have some MTA(message or mail transfer agent) installed to send email. The two most common are Postfix and Sendmail. If you install Postfix and just go with the defaults you should be able to send email.
 
1 members found this post helpful.
Old 06-26-2014, 12:24 PM   #6
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
Thanks kilgoretrout, appreciate your help.
 
  


Reply


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
pxe boot "ubuntu precise" from nfs root - / not found. lievendp Linux - Server 2 08-28-2012 05:20 PM
Mail from root@localhost.localdomain thru relay=localhost.localdomain[216.24.138.1] rshartog Linux - Server 2 02-02-2009 11:35 PM
mail daily root@localhost to private email? robberttheman Linux - Newbie 4 08-27-2004 08:36 AM
I need a program to view (as root) multiple maildir's & move mail between them fuzzyash Linux - Software 2 02-17-2004 09:03 PM
recieving root at localhost mail GraemeK Linux - Networking 10 08-29-2003 03:16 AM


All times are GMT -5. The time now is 04:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration