LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-18-2009, 05:48 AM   #1
hopefull
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian Etch/Lenny, RedHat Enterprise 5.2.
Posts: 20

Rep: Reputation: 0
problem with mail command


I have a problem with command mail

On my lInux box i have two user: root amd test_user

When in a root shell i type mail, i have:

No mail for root

But there are at least cron mail!

If i type mail in a test_user shell, i see also root mail!

How is possible this? How i can configure mail correctly?

Thanks
bye
 
Old 01-18-2009, 05:56 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
First thing to check is the user's details. When you create a user through the graphical tool, one of the options usually is "Receive System Mail" or something similar. Also check the MAILTO variable set in /etc/crontab and see if it points to test_user.
 
Old 01-18-2009, 06:05 AM   #3
hopefull
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian Etch/Lenny, RedHat Enterprise 5.2.
Posts: 20

Original Poster
Rep: Reputation: 0
In /etc/crontab file MAILTO is not present so cron mails are sent only to root

The problem is that i can't read this (and other) mails from shell root

Instead from test_user shell i can read all mails, also when in TO there is only root

For use details, i have not seen nothing of strange from GUI tool; are there conf file to check?

Thanks
Bye
 
Old 01-18-2009, 06:29 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
What about checking /var/log/mail? It should report about every mail activity and tell if messages to root are forwarded to a local user for some reason. Please provide other useful information about the OS running on your machine (you can put this on your LQ profile, so we can see it in the box on the right of your posts) and the mail service. If in doubt try the following command to find out:
Code:
netstat -anp | grep LISTEN | grep :25
to see which process is listening on port 25 (mail) on the localhost.

Moreover, have you tried to send a mail to root from test_user's command line? Is it correctly received?

Last edited by colucix; 01-18-2009 at 06:33 AM.
 
Old 01-18-2009, 06:54 AM   #5
hopefull
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian Etch/Lenny, RedHat Enterprise 5.2.
Posts: 20

Original Poster
Rep: Reputation: 0
I put info on my os in my LQ profile, however is Debian etch -4.0

The process listening on port 25 is exim4

I have sent a mail to root from user_test and also in this case the mail is readable from user_test shell and not from the root one, in which i have: No mail for root

In my mail.log file i have only rows as:

Jan 18 14:33:01 localhost sa-exim[7287]: Removed 0 of 0 greylist tuplets in 0 seconds
Jan 18 14:33:01 localhost sa-exim[7287]: Removed 0 of 0 greylist directories in 0 seconds
 
Old 01-18-2009, 07:32 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Ok. Maybe I'm wrong but it does not look like a mail problem, in the sense the mail service works and it probably acts following some "hidden" configuration. Another thing that comes in my mind (since mails are re-directed to the local user) is the presence of a .forward (hidden) file in root's home.

Regarding the crontab issue, not all systems send cron mails on a regular basis. On Fedora you will get a "Log Watch" mail every day, whereas on OpenSuse you get... nothing. I don't know about Debian. Anyway, even if Debian sends mail to root, they are forwarded to the local user in this case.
 
Old 01-18-2009, 08:23 AM   #7
hopefull
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian Etch/Lenny, RedHat Enterprise 5.2.
Posts: 20

Original Poster
Rep: Reputation: 0
Ok
In fact it is not a problem about mail daemon, but mail configuration
With your suggestion, i have seen for forward rules, so i have found in /etc/aliases the entry:

root:user_test

present for security issue.Cut this entry, i can read mail from mail shell with type
mail -u mail

also this for secrity issue, because mail to root are delevered to mail user

Thanks
bye
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 08:33 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
Problem with mail command srihariv Linux - General 3 02-25-2008 02:20 AM
Problem with mail command Abhinav Kakkar Linux - Software 2 09-03-2007 04:23 AM
problem with mail command a5an0 Linux - Networking 2 05-09-2005 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:46 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