Solved

How to disable root from sending out emails to localhost?

Posted on 2004-09-10
8
655 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
interanl url error in exchange 2013 sp1 5 39
SPF record 3 50
Are external E-mails being sent to distribution groups? 6 41
What is meant by  Recovery False in 4 21
Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
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.
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 an Address List 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 Organization >> Ad…

810 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