Redirect Mail and Create Aliases

 

By far the simplest way to redirect mail for existing users and also for users that don’t exist is by adding an entry in the /etc/aliases file.

If you are competent with using the visual editor (vi) command, then head on over to the /etc directory and insert your alias at the bottom of the file:

Tones: # vi aliases
manager: myboss
tone: tone@anydomain.com

Note the ‘:’ which MUST be present.

All mail to ‘manager’ on the local domain will be redirected to ‘myboss’ on the local domain.
On the second line I am redirecting all incoming mail addressed to tone@thisdomain.com to an external email address tone@anydomain.com

The /etc/aliases file is read before local mail delivery takes place; so if you want to redirect the mail of a user who does actually exist on the local server, just add an entry for a name of your choosing and then specify the redirected to address as I have above.

Write your file away and depending on the flavour of UNIX/Linux you are using, you will need to remake the ‘aliases.db’ by typing the following:

Tones: # newaliases

This method is by far the simplest way of achieving the above.

Good to go.

Tone.

Leave a Reply

Your email address will not be published.Email address is required.