Linux: Forward root user mail or any user to another different address

If you are using Linux as a web server, and need to keep the root user's mail inbox from filling up, you can have it forwarded to a different email address. This will also work for any user.

  • Switch to the user's home directory:
    cd ~/
    cd /home/userNameHere
  • create a new file called:
  • Enter the address to foward to:
  • Enter additional emails to forward to on separate lines, if needed.
Note: cd is not a command that can be used with sudo, so you may need to switch to the root user first by using:
sudo -i

No comments :

Post a Comment