CentOS Linux Server Guide

CentOS Mail Server

Mail Alias

 

Mail alias/ Mail aliases are used so that one or more users can receive mail sent to root or other users such as webmaster, bin, daemon etc.

 

Step1: Configure Mail Alias

The configuration file for aliases is stored at /etc/aliases and format is as below:

 

[Format]

Receiving Account or other aliases : recipient A, recipient B, recipient C ..

 

Example 1 : Redirect Emails to another user(s)

root: root, james

 

The above example, we are redirecting root's email is now receiable by both username james and root.

 

Example 2: Setup Group Email

class2010: james, ann, mark

 

The above example, we are setting up group email name class2010. When Tutor sent an email to class2010@1a-centosserver.com, all the students (ie, james, ann and mark) will receive a copy of email.

 

 

Step2: Activate mail alias using "newaliases" command

When you edited /etc/aliases file, the "newaliases" command must be executed in order to update the aliases database.

 
#newaliases

 

Let's look closer at /etc/aliases, you will notice that most of the bin, daemon lp ...are aliased to root, which means that all mail sent to these accounts will be redirected to root's mail
#
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks or from /bin/mail.
#
# >>>>>>>>>> The program "newaliases" must be run after
# >> NOTE >> this file is updated for any changes to
# >>>>>>>>>> show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon: postmaster
postmaster: root

# General redirections for pseudo accounts.
bin: root
daemon: root
adm: root
lp: root
sync: root

...

 

Back to CentOS Mail Server



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy