Web Hosting Talk







View Full Version : How-to - Get eMail Sent to Root.


MjrGaelic
01-21-2004, 04:37 AM
Every night your system does the cron.daily routine and emails you a good deal of information to root@localhost; namely log highlights etc. This shows whos been logging in, and whos be "trying" to log in.

This will send "all" email directed to root@localhost to your specified email address..

Usage: (you must be root for this)

1. cd /root
2. vi .forward

type the following into .forward

root:youremail@yourdomain.com


3. chmod 755 .forward

All done.

Removal:

Simply remove the .forward file.

1. rm .forward

Regards,

Ryan

eBoundary
01-21-2004, 09:08 PM
you may want to specify which MTA this is for, not all SMTP servers honour the .forward and even if they do there are different formats for these files.

<edit>signature removed</edit>

Winkie
01-21-2004, 09:13 PM
Agreed, you may also with to add in that you can set up similar redirects using /etc/aliases


I'll write a tutorial on exim 4 w/mysql support soon

<edit>signature removed</edit>

MjrGaelic
01-21-2004, 10:10 PM
My appologies..

This works for using Sendmail as your MTA, I have not tested it with other MTAs.

Ryan

Cirrostratus
01-29-2004, 03:35 AM
For folks running FreeBSD + Sendmail or any other MTA which uses the mailerconfig file you can do the following to get your root mail.


% vi or ee /etc/mail/aliases

Edit the entry for

# root: me@my.domain

Replace it with your email address.

root: foo@barfoo.com

Then save the file and type
% newaliases

You will see a message about success rebuild of the aliases db and you will be good to go from there.