LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 12: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, 12:29 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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, 12: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, 06: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



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 10:18 AM
All I want is to forward mail charlweed Linux - Networking 3 01-27-2005 10:16 AM
sendmail: not possible to pipe mail to programs using ~/.forward && /etc/mail/aliases fhd Linux - Networking 1 01-09-2005 06:05 PM
forward mail for root linuxtesting2 Linux - Newbie 1 07-06-2004 02:07 PM
cant see .forward file in home directory >> mail forward/copy steve_babbage Linux - Newbie 0 03-02-2004 06:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:21 PM.

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
Open Source Consulting | Domain Registration