How to Forward Email To Another Email Account Postfix in Linux

Step 1: Modify /etc/postfix/main.cf File

# vi /etc/postfix/main.cf
virtual_alias_domains = tecdistro.com 
virtual_alias_maps = hash:/etc/postfix/virtual

Step 2: Configure /etc/postfix/virtual File

Forward email sent to user1@tecdistro.com to support@tecdistro.com. We can also implement a catch-all address i.e. email sent to user1@tecdistro.com should be forwarded to support@tecdistro.com

# vi /etc/postfix/virtual
user1@tecdistro.com   support@tecdistro.com
@tecdistro.com         support@tecdistro.com

Step 3: Execute postmap Command

Create the hashed file (.db) using postmap command.

# postmap /etc/postfix/virtual

Step 4: Reload postfix

Now reload the postfix service:

# service postfix reload
2 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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

3 + 8 =