Most linux systems can send system messages to the root account, which is all and well. However, for practical purposes it's easier if the mails would be sent to a mail account you monitor frequently.
This is what this short article will review.
I use Ubuntu-Mate 19.10 Eoan Ermine on my personal admin-workstation at home.
Postfix is installed. If it isn't, install it like this.
$ sudo apt install postfix
- Edit /etc/aliases. You should see a few lines there with postmaster: root. Add a new line as below, pointing to your external mail address.
For future purposes you might also want to add your own local user account to this list.
- Run the newaliases command to make post aware of the new alias.
/etc/aliases: 77 aliases, longest 17 bytes, 792 bytes total
- Restart the postfix daemon for good measure.
# service postfix restart
- Send a test mail.
- Check your mailer to see if the mail shows up there.
All okay? Congrats, it's working!