Solved

How to disable root from sending out emails to localhost?

Posted on 2004-09-10
8
653 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 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

Automapping, a wonderful feature with Exchange 2010 (SP2 onwards I believe), allows additional/Shared mailboxes that a user has access to be automatically mapped on Outlook client, simplifying the process by adding them while Outlook launches. Ho…
Nearly six years ago I was hired by a company to be their senior server engineer. One of my first projects was to implement Exchange Server 2007 on a Windows Server 2008 Single Copy Cluster for high availability. That was the easy part; read on to l…
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…
In this video we show how to create a User Mailbox 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 >> Mailb…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now