Forward The Root Users Email On Linux

Author: Steven Neiland

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

This is a simple little trick I came across the other day while I was debugging an unrelated issue with my server.

Certain process's will send an email to the root user of a linux server to notify you of an issue, cron for example. However if you are not in the habit of logging into the server on a regular basis this can be a problem if an issue is urgent.

Fortunately it is really easy to forward email destined for the root user to another email (say a postfix mail account). All you need to do is create a file named ".forward" in the "/root/" directory and on the first line enter the email address you want to forward to.

This should work for regular users also, just put the .forward file in their home directory. I don't think it can get any simpler than that.

Reader Comments

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain advertisments or appear to be created for the purpose of link building, will not be published.

Archives Blog Listing