Email Aliases and Forwards in Postfix
From Zanecorpwiki
Aliases and forwards are added by editing entries in the virtual table. Open up the file /etc/postfix/virtual. The first part of the file gives a good overview on how to use the file. Entries and changes should be made at the end of the file.
An alias sends mail directed to one user within one of the local domains to a named user on the system. The form is simply:
alias user
The space can be any kind of whitespace. For instance,
info john.smith
Would send all mail addressed to info at any of the local domains to zane. (Untested:) You can limit the aliases to a particular domain as well:
info@somedomain.com john.smith info@somedomain.com john.doe
A forward is just like an alias, except you provide the email address instead of the user name:
support@somedomain.com guy@acme.com
Would send mail addressed to support@liquid-labs.com to guy@acme.com.
You can also create a group alias like this:
group@somedomain.com john.smith,jake@someotherdomain.com
After you're done with your edits, run 'postmap /etc/postfix/virtual'. This creates the virtual.db file which Postfix loads to do the alias lookups. Postfix will pickup any changes in a few minutes. For more immediate results, run '/etc/init.d/postfix restart'. Remember, this is all done as root.
You can also specify aliases in the system '/etc/aliases' file. Postfix will use both sets of aliases. As far as I know, the two methods are pretty much the same except that (again, AFAIK) you can specify a domain in the alias in the aliases file since in that file you're listing system users and not email addresses. I may be wrong about that though. In any case, I recommend only using the virtual file in order to keep things clear. However, if you're not sure why some user is getting email from an aliased address, you'll need to check both.


