Creating Aliases and Mail Redirects

More information about Real Time's products & services is available on our sales web site. Direct links for each item are listed below:

How to set up aliases and mail redirection.

Probably the simplest way to redirect mail (either from users who don't exist, or from users who do exist) is with the /etc/aliases file. The format is pretty simple; just follow the examples, which are like so:

1manager: 2root
3support: support@externaldomain.tld

1 On the left-hand side is the address on the local machine which you'd like redirected. So in the first case, manager@domain.tld is the address which will be redirected.

2 On the right-hand side is the address it should be redirected to. So in the first case, manager@domain.tld will be redirected to root@domain.tld

3 In the second case we have a slightly more complicated version; whereby mail is being sent to an outside address; in this case, support@domain.tld is being redirected to support@externaldomain.tld

Note that the /etc/aliases file is read before local delivery takes place; so if you want to redirect the mail of a user who does actually exist, you can just add an entry for their name, and then specify where you'd like mail redirected to.

Editing this file deserves a bit of caution.

The file itself is not read by sendmail; a database is created from the file, and *that* is then read by sendmail (this is done for speed reasons). It's no longer rebuilt automatically (for security reasons); so you *must* remember to rebuild the aliases database immediately upon exiting editing the file (otherwise the log will fill with errors, one for every mail sent).

This is done with the 'newaliases' command. To make sure you always remember to rebuild the database (and do it as absolutely quickly as possible upon exiting editing the aliases file); edit the aliases file like so:

# vim /etc/aliases;newaliases

This will cause the 'newaliases' command to be run immediately when the vim process exits.

There are a number of other ways to redirect mail and answer mail for nonexistent users; but this is probably the simplest way in most cases.


The instructions and screen shots contained within this website are specific to services offered by Real Time Enterprises only.



Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Real Time Enterprises, Inc.

Real Time Enterprises, Inc.
10181 Crosstown Circle
Eden Prairie, MN 55344

Phone: (952) 943-8700
Fax: (952) 943-8500

Open Linux Menu
Open Macintosh Menu
Open Windows Menu
Open Source Menu
Website Search
Send Email