Linux mail forward

From John Freier
Revision as of 11:50, 31 August 2012 by Jfreier (Talk | contribs) (Set up the domain)

Jump to: navigation, search

This will forward roots mail. Edit the aliases file.

vi /etc/aliases

Go to the last line in the file (shortcut key 'G') and add the new email address.

# Person who should get root's mail
root:           root, freier@gmail.com


Set up the domain

This is to setup the domain so it doesn't send mail from localhost.localdomain

Make sure you do a back up, I have not got this to work yet.

Before I started these commands I needed to install m4 and sendmail-cf

yum install m4
yum install sendmail-cf

Also mail didnt come with fedora 13 so I needed to install it

yum insatll mailx

1. Edit sendmail config

# vi /etc/mail/sendmail.mc

2. Append/add/modify the lines as follows:

MASQUERADE_AS(cyberciti.biz)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(cyberciti.biz)dnl

3. Save and close the file. Replace domain name cyberciti.biz with your actual domain name. Update and restat sendmail server:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# /etc/init.d/sendmail restart