3

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.

  • mail aliases? – Bratchley Aug 4 '16 at 15:59
  • loojks like a rootly power is needed so no, mail aliases arent an option – j0h Aug 4 '16 at 19:39
3

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
  • .forward was to be active by default in the old systems of lore with sendmail; it also has security implications. As I understand it, the odds of this solving the OP problem in a modern system is low, but I can be wrong. – Rui F Ribeiro Aug 4 '16 at 15:38
  • .forward for plain old email forwarding should still work (it does on all my machines!), but using it to filter mail... that got restricted a long time ago :-) – Stephen Harris Aug 4 '16 at 17:23
  • Simple forwarding should be enabled. At one time .forward could run any arbitrary program or script. The running of arbitrary programs or scripts is generally disabled. Forwarding to gmail or any other major freemail service may not work without acreditation. – BillThor Aug 5 '16 at 1:33
  • Hey it worked! (It took me a bit to figure out that it had been sent to spam via gmail.) – j0h Aug 5 '16 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.