Forwarding Root Notifications / Mail from Linux Server to Corporate Admin E-mail Account

Mindwatering Incorporated

Author: Tripp W Black

Created: 07/31/2014 at 05:59 PM

 

Category:
Linux
Mail

Issue:
Need to setup root or other service notifications on a Linux box to be forwarded by Postfix to the corporate mail system for monitoring by an admin account.

Solution:
Note: This tutorial assumes you are running Ubuntu, CentOS, RedHat, or some other flavor of Linux running the Postfix mail system.

Perform the following to tell the Linux system to send all local mail from the user "root" to an admin at Mindwatering.net.

1. Update the etc/aliases file.
# vi /etc/aliases
(Click a to add text at the cursor position. add or update the following line starting with root: )
root: mwsupportadmin@mindwatering.net
(Click esc to end input of text, enter wq to save changes and exit the vi program.)

2. Run the new aliases file update program:
# newaliases

3. Restart Postfix on the server:
# service postfix restart


Note:
You can send an e-mail test via the mail program if it is installed.
# echo test | mail -s "Test Message" root






previous page

×