Postfix: forward all account email within domain to another email account?
Hello. Im pretty sure this is trivial to config, but I havent had any luck searching on google.
My situation is: I want to forward any emails sent to my domain to another account. So:
You mean a catchall? That catches emails that don't get delivered anywhere else.
There's also a bcc map which can send copies to a email address if you send or receive.
My situation is not catchall. Catchall mode will deliver mails of non-exist users only
But I need all mail to be delivered, doesnt matter if recipient is exist or not
Yes, you can
What you are looking for is a virtual alias table and can be done using the following...
First you need to edit, or create if it doesn't already exist, the /etc/postfix/virtual file.
After this has been saved you will need to run postmap /etc/postfix/virtual in order to generate the indexed /etc/postfix/virtual.db Postfix will read.
You will then need to edit the /etc/postfix/main.cf and be sure that you have the following line uncommented:
virtual_alias_maps = hash:/etc/postfix/virtual
This will actually let postfix know about the virtual alias table and use it.
The problem with using the luser_relay option as others have mentioned is that this is treated as the user of last resorts for unknown addresses by the local delivery agent. If postfix is only handling mail for one domain this can be utilized for this but it can mask other configuration errors and will likely cause unexpected results if more than one domain is being handled.
The one caveat I feel obligated to mention is that by creating a wildcard alias of this nature you are opening up your mail system to accept messages for addresses that will not exist and run the risk of having the mailbox filled quickly with spam for non-existent mailboxes.
|All times are GMT -5. The time now is 08:03 PM.|