Aliases Guide Ma3oxuct A guide to make users aware that their machines may be sending out emails to wrong or unknown places, and how to fix this. 1.0 2006-03-17 Aliases
Significance

Applications such as Apache or a cron daemon often need to send mail to a user (often the root user) to inform him of an error or simple operations. When a system is not properly configured to relay these emails, some problems may arise, which may not be noticed. For example, a job is set up in a cron daemon. This job outputs some sort of message. What the cron will do (by default) is send an email to root@localhost. However, because root@localhost is not a real email address, the email will be sent out to no one knows where and bounce. The bounced email will most likely make its way to your ISP's servers (or other email servers on its way). This mini-guide explains how to configure your machine to make those emails (which, in my experience, could have posed a security risk for me) come to you rather than strangers.

Aliases

Use your favorite editor and open up /etc/mail/aliases.

Open /etc/mail/aliases.
# nano -w /etc/mail/aliases

You only need to make two changes:

# Basic system aliases -- these MUST be present.
MAILER-DAEMON:      postmaster
postmaster:         root

# General redirections for pseudo accounts.
adm:                root
bin:                root
daemon:             root
exim:               root
lp:                 root
mail:               root
named:              root
nobody:             root
postfix:            root

# Well-known aliases -- these should be filled in!
root:               [Put your email here]
operator:      	    [Put your email here]

# Standard RFC2142 aliases
abuse:              postmaster
ftp:                root
hostmaster:         root
news:               usenet
noc:                root
security:           root
usenet:             root
uucp:               root
webmaster:          root
www:                webmaster

# trap decode to catch security attacks
# decode:           /dev/null

That is it. Now all applications that need to send emails to any of the users above will email to you.