?
Solved

How to disable root from sending out emails to localhost?

Posted on 2004-09-10
8
Medium Priority
?
664 Views
Last Modified: 2013-12-17
I've been seeing this lately on my server where root sends out an email for basically anything it does e.g. when an mrtg command is ran from cron it sends out an email to localhost which fails and gets stuck on the clientqueue.  Is there anyway to disable root from sending out emails for anything it does?

thx.
G
0
Comment
Question by:m3m0
  • 3
  • 3
  • 2
8 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 12026555
No, not easily, because "root" on a *NIX system is basically unlimited, by design. You can't set file/directory permissions that root can't override.

Fiddling with root's path to make it unable to see the mail software is dangerous.

Why not simply remove the cron jobs generating the E-mail, or modify them so they do not generate an E-Mail? Seems a lot simpler than trying to thwart a basic *NIX design.
0
 

Author Comment

by:m3m0
ID: 12026686
I cant remove the cron as they generate our mrtg graphs for our network, and they are simple crons set not with the intention of having root sending out an email to localhost everytime the commands run.  
0
 
LVL 18

Accepted Solution

by:
liddler earned 600 total points
ID: 12026924
As PsiCop says, it's cron that's doing it
change your cron job to be
10 10 * * * /path/to/mrtg > /dev/null 2>&1
and no mails will be generated
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 34

Expert Comment

by:PsiCop
ID: 12027533
Thanks, lidder. I couldn't remember the syntax and I didn't have a *NIX box handy to check.
0
 
LVL 18

Expert Comment

by:liddler
ID: 12027614
No UNIX box in front of you? Isn't that a sin?
0
 

Author Comment

by:m3m0
ID: 12027771
cool i made the change and now its working.  But for some reason now and alerts that are sent from nagios(the monitoring tool) get queued on the clientque folder.  This is driving me nuts.
0
 
LVL 18

Expert Comment

by:liddler
ID: 12027864
Not used nagios, but I assume it's got a mailing facility and that can be switched off.....
from this: http://article.gmane.org/gmane.network.nagios.plugins/837

>>The sending-mail command is defined in the configuration, so it
>>is whatever that command does. You can change it to use a
>>different command that supports the mail routing you want.

so have a look for the sending-mail command
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 12028057
"No UNIX box in front of you? Isn't that a sin?"

Unfortunately, when you're a multi-platform sort of guy, it happens.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question