Main Contents

Redirect root mail to an external e-mail address

July 29, 2008

This uses postfix, my mail transport of choice.

Configure /etc/postfix/ as below. (If you already have a local MTA running, skip this section.) Also, this allows any other mail to be sent from your box, not just for root.

myhostname = host.domain.tld
mydomain = domain.tld
myorigin = $myhostname
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks =
relayhost = [your.mail.server.ipaddress]

Add this line to the bottom of /etc/aliases:


Run this command:


Restart postfix and use this to test:

echo test | mail -s "test message" root

Filed under: Linux | Comments (1)

1 Comment

  1. guest March 8, 2009 @ 5:29 am