Solved

How to disable root from sending out emails to localhost?

Posted on 2004-09-10
8
659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…

729 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