MBF Knowledge Base

I am trying to get Postfix to forward all email for any address to an external email address. It is not working. How do I fix this?

1.) Add the folowing line to the end of your main.cf file:

virtual_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp

2.) Create a file which lists the email address you want all email to be sent to:

vi /etc/postfix/virtual-regexp

3.) Add the following:

/.+@.+/ forwardingmailaddress@gmail.com


4.) Add it to postmap:

postmap /etc/postfix/virtual-regexp


5.) You will need to add a virtual file:

touch /etc/postfix/virtual


6.) Now add it to postmap:

postmap /etc/postfix/virtual