Sometimes you may receive email failure messages when your computer tries to send a mail to a linux user regarding things like errors in cron jobs, etc. and the email address is not a valid one , e.g. root@your-computer-name. To fix this, set up forwarding of emails or aliases for your linux users. Here are the steps to setting up aliases, assuming we want to do this for the user root.
- Open the aliases file :
$ sudo vim /etc/aliases
- Enter the new alias you want on a new line in the following format
- Save and close the file
- Run the newaliases command
Now that this is done, the computer will send all root’s future emails to email@example.com