.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.

Example

To create a .forward file, you can run

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

Leave a Reply

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