.forward file

Users can create a .forward file in their home directories that is used by mail servers like exim, sendmail used to redirect email to another email account.

When mail is sent to a local user, the sendmail command checks for the $HOME/.forward file. The $HOME/.forward file can contain one or more addresses or aliases. If the file exists, the message is not sent to the user. The message is sent to the addresses or aliases in the .forward file.

On Cpanel servers, /root/.forward contains the email address of the server administrator, so all emails to root get forwarded to the Server Admin email account.

Advertisement

Example

[root@server52 ~]# cat /root/.forward
admin@serverok.in
[root@server52 ~]#

To create a .forward file, you can run

echo "you@gmail.com" > ~/.forward

This will create a file $HOME/.forward with your email address inside it.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement