среда, 14 января 2015 г.

Forward local emails to external email

Very often when you go to server via ssh you see:

You have mail.

Which you can see into /var/mail/ubuntu. Yep yo can see it on server by mutt.
Other solution is to forward it to another email which you check daily:

1. Instal mailx. To check all is ok:

#echo 'it is test' | mailx -s 'test email' 'my@email.com'

2. https://help.ubuntu.com/community/PostfixBasicSetupHowto#Per_User_.forward_Files
Add your email to the .forward file into home folder:

Per User .forward Files

Users can control their own mail delivery by specifying destinations in a file called .forward in their home directories. The syntax of these files is the same as system aliases, except that the lookup key and colon are not present.
I will illustrate an example here:
Assume that you need to forward all the mails which come to the sysadmin account to an another account. Enter the following commands:
su - sysadmin
touch .forward
Then open the .forward file
vi .forward
Add the following code:
fossedu@example.com
Remember to use email address which exists in this exercise.


Now send a mail to sysadmin and mail should come to fossedu@example.com


Комментариев нет:

Отправить комментарий