Postfix Forward Email To Another Email Account

www.la‮c.iruttu‬om
Postfix Forward Email To Another Email Account

To forward email from one account to another using Postfix, you can use the following steps:

  1. First, create a file in the /etc/postfix directory called forward that contains a list of email addresses to forward. Each line of the file should contain an email address, followed by a colon (:) and the email address to which you want to forward the email. For example:
user1@example.com: user2@example.com
user3@example.com: user4@example.com

This will forward all email sent to user1@example.com to user2@example.com, and all email sent to user3@example.com to user4@example.com.

  1. Create a file in the /etc/postfix directory called forward.db by running the following command:
postmap /etc/postfix/forward

This will create the forward.db file, which is used by Postfix to look up the email addresses to which email should be forwarded.

  1. Edit the /etc/postfix/main.cf file and add the following lines to the end of the file:
virtual_alias_maps = hash:/etc/postfix/forward
virtual_alias_domains =

This will tell Postfix to use the forward file as a virtual alias map and to consider all domains as virtual alias domains.

  1. Reload the Postfix server to apply the changes by running the following command:
service postfix reload

This will reload the Postfix server and apply the changes you made to the configuration.

From now on, all email sent to the email addresses listed in the forward file will be forwarded to the email addresses specified in the file.

For more information about how to configure email forwarding in Postfix, you can consult the Postfix documentation or use the man postfix command to see the manual page.

Created Time:2017-10-30 14:27:11  Author:lautturi