Disable emails to root and freebsd

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
I can use webmin to look at the messages, but it seems root keeps getting tons of emails each night after the system does its things.

How can i disable this?
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Depends on your mail setup, but in /etc/mail/aliases (or similar location) you can map root's mail to get sent to another user's.
 

JW310

Golden Member
Oct 30, 1999
1,582
0
0
Originally posted by: BingBongWongFooey
Look into the system crontab then, there should be a cron job that's doing it, just comment it out.

But then wouldn't that also stop the cron job?

If you want to have your cron jobs still run, and don't want any e-mail going to the root account, create a ".forward" file in root's home directory. The contents of the file should be "/dev/null"... This should send all e-mails that go to the root account to the NULL device, effectively deleting them.

JW
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Combining what's been said, you can alias to /dev/null as well.

More generally, for Sendmail, you can restrict which users receive mail using the /etc/mail/access file. Add a line like

To: root@mydomain.com DENY

and rebuild the access map with makemap hash access < access.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: JW310
Originally posted by: BingBongWongFooey
Look into the system crontab then, there should be a cron job that's doing it, just comment it out.

But then wouldn't that also stop the cron job?

If you want to have your cron jobs still run, and don't want any e-mail going to the root account, create a ".forward" file in root's home directory. The contents of the file should be "/dev/null"... This should send all e-mails that go to the root account to the NULL device, effectively deleting them.

JW

I never said disable all cron jobs, I said disable the one you don't want to get mail about. From what I gathered, he's talking about the system check thingies that diff important files and give info about disk space, network activity, etc, they serve only an informational purpose, and if they're not being mailed to anyone, there is no reason to run them.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Forward the mail to an account you will check regularly, you'll be pissed when you find out a cronjob isn't running properly and you missed the email notification because it was sent to /dev/null.