LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2005, 01:25 AM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
How to forward mail to root?


As a lot of the email like for logwatch is going to the root account, how can I actually set it up that everything send to root is then forwarded to another email address.

Not just for logwatch but basically anything across the boad.

Thx.
 
Old 06-20-2005, 01:29 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Two ways:

(1) Create a .forward file in root's home dir with the address(es) you want the mail forwarded to.

(2) Edit /etc/mail/aliases (format should be straightforward just looking at the file).
 
Old 06-20-2005, 01:36 AM   #3
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
Thx, that should get me going, now in order for me to test this.

How can I force an event that would send mail to that root account?
 
Old 06-20-2005, 07:13 AM   #4
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally posted by stefaandk
Thx, that should get me going, now in order for me to test this.

How can I force an event that would send mail to that root account?
No need to force an event. While logged into the system you are trying to configure, just send an e-mail to root. If you have configured /etc/aliases correctly, then the e-mail will be sent to the aliased account. Thus, when logwatch runs, the report will be sent to the aliased account.
Code:
[scowles@excelsior ~]$ mail root
Subject: Test
This is a Test.
.
Cc:
[scowles@excelsior ~]$
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sendmail forward all incoming mail to localhost port 26 (Domino mail) speedgelb Linux - Software 3 09-27-2013 11:18 AM
All I want is to forward mail charlweed Linux - Networking 3 01-27-2005 11:16 AM
sendmail: not possible to pipe mail to programs using ~/.forward && /etc/mail/aliases fhd Linux - Networking 1 01-09-2005 07:05 PM
forward mail for root linuxtesting2 Linux - Newbie 1 07-06-2004 03:07 PM
cant see .forward file in home directory >> mail forward/copy steve_babbage Linux - Newbie 0 03-02-2004 07:25 AM


All times are GMT -5. The time now is 07:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration