How to automatically forward system mail

emailmail-command

I have a system job that fails and sensd me mail that I can read with the mail command. That means I still need to login to the mail server to get the emails and read them. The server supports sending mail to external clients, such as gmail. How can I set mail to automatically forward my mail to my gmail?

I am not the system administrator, and do not have root access on this system.

Best Answer

You can create a .forward file in your home directory, and the mail will be forwarded.

cd 
echo "username@gmail.com" > .forward
chmod 644 .forward                 # change permission else it won't work
Related Question