tag:blogger.com,1999:blog-7153440860142288256.post-49936475706943740902008-01-17T14:13:00.005+01:002008-04-08T19:52:49.488+02:00Linux - Automatic Forward to another Email address<div align="justify">I need to forward email received on my linux server to my real daily address.</div> <span class="fullpost"> <div align="justify"> <strong>Root account</strong></div><div align="justify">editing the file /etc/aliases we can add an email alias for every account on the server</div> <blockquote> <pre> ... ftp-adm: ftp ftp-admin: ftp www: webmaster webmaster: root noc: root security: root hostmaster: root info: postmaster marketing: postmaster sales: postmaster support: postmaster # Person who should get root's mail root: root ... </pre> </blockquote> <p>so in this case we can write:</p> <blockquote> <pre> ... root: root, example@domain.com ... </pre> </blockquote> <p>running the command newaliases the change will take effect:</p> <blockquote> <pre> [root@localhost ~]# newaliases /etc/aliases: 77 aliases, longest 22 bytes, 791 bytes total [root@localhost ~]# </pre> </blockquote> <p align="justify">every mail to root@localhost will be forwarded to example@domain.com leaving a copy on the server.</p> <p><strong>User account</strong></p><p>to forward user address without root privileges, just create the file .forward in the home directory with inside the name of the mail address:</p> <blockquote> <pre> [dettox@localhost ~]$ pwd /home/dettox [dettox@localhost ~]$ echo "example@domain.com" > .forward [dettox@localhost ~]$ chmod 644 .forward [dettox@localhost ~]$ </pre> </blockquote> <p align="justify">every mail to dettox@localhost will be forwarded to example@domain.com without leaving a copy on the server. </p> </span>DeTToXhttp://www.blogger.com/profile/10702455931072364257noreply@blogger.com