Jump to content

Can't get root to receive mail using the 'mail' command


Recommended Posts

Hi,

 

I'm using the 'mail' console command because I am now using the logchecker.sh script from the Mandrake CDs to check my logs for intrusions and the mail command is used to send any suspect actions to root. Well it should do but the message doesn't get to root, it stays in the file /var/spool/mail/postfix and I don't know why. If I send mail as root to a user the user gets the mail, but it doesn't work the other way around. Any help would be appreciated.

Link to comment
Share on other sites

When you use the mail command, it is sending the request (for sending the mail) to postfix (or an equivalent if you don't use the default). Postfix is configured with default aliases so that root's mail does not get sent to root but to a real user. You probably did not configure the file, so by default, the "real" user is postfix (the only user Postfix is sure is existing).

 

For changing this behaviour, go and see the aliases file in /etc/postfix.

 

Yves.

Link to comment
Share on other sites

Thanks theYinYeti :D

 

It works now. root cannot accept mail through root, it has to be sent to a user because of privileges.

 

For the record, I had to change two items in /etc/postfix/access :-

 

--------------------------------------------------------------

postmaster: root <-- change this to a user name e.g. --> postmaster: simcon

 

root: postmaster <-- change this to a user name e.g. --> root: simcon

--------------------------------------------------------------

 

I changed them to my login name and it works. I now receive mail for root in my user account :D

 

Cheers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...