How to setup an email alias in Linux with Sendmail system installed August 16, 2010Posted by jbanju in LINUX CentOS.
1. Login with root user ID
2. Edit the /etc/aliases file (with vi editor)
3. Append / change an email alias in this format
alias_name: email_id1 [, email_id2,] …
E.g. append this new email alias to the /etc/aliases
blogadmin: email@example.com, firstname.lastname@example.org
4. Save and exit the alias file
5. Execute the newaliases command followed by echo $? (suppose there is no error found, you will get a 0 returned by the echo command).
Alternatively, you can execute the equivalent sendmail -bi command (since this is a Sendmail system)
By now, you should test and confirm the works done so far. E.g. send an email to the email alias:
mail -s “testing with aliases name blogadmin” blogadmin
Mission completed if you the email in both inboxes (in this example, these are email@example.com and firstname.lastname@example.org).
root: /dev/null #Send root mail to null