Understand Postfix Account Types
Postfix documentation attempts to explain the different types of users or ways to handle users. Here is a simplified list of user types, and how they differ.
1. A local system user receives mail for the primary machine domain. 2. A local system user receives mail from an alias virtual domain 3. A non-system user receives mail in a special virtual mailbox for any domain on the system.
Type 1 - If a user is in /etc/passwd then he or she is a user of the system. Traditionally that meant that his or her email account matched the system login username. So if Nicole’s login name in /etc/passwd is ‘nicole’ and the server domain is foo.com, Nicole would receive email to nicole@foo.com. Furthermore, if additional virtual domains are on the system, for example, abcdomain.com and defdomain.com, the user nicole would receive mail them too. Basically, nicole@any-domain-on-the-system will receive mail. This is the way things were back in the early sendmail days.
Type 2 - An email address is created, nicolemyspace@foo.com, so Nicole can use it to get her MySpace website related email, but there is no unix account called ‘nicolemyspace.’ Instead, the mail goes into her nicole unix account. Some mail systems are configured to accept mail for both nicole@ (the primary server domain) and any custom address from any domain hosted on the system. An alternative is to configure the system to not accept mail for the unix account name by default. This is something sendmail is limited in capability, and why mail administrators have turned to postfix as an alternative to sendmail.
Type 3 - Rather than having a unix account for all of the system mail users, especially since most only use email and would never need to login to the system for anything else, a nice option is the virtual mailbox for virtual users. This is inherently more secure. Mail users do not have real unix accounts on the system. There is a separate table of virtual users that can receive email from any domain on the system.
Combinations of the above are all possible with postfix. Consider that Kevin does not have a unix account on the system. Kevin is a virtual user, and authenticates with the username ‘kevin@otherdomain.com’ to retrieve his email. Kevin uses a weak password, so it is good that he doesn’t have an actual unix account on the system. Kevin wants to have an additional email address, ‘packersfan@foo.com’ to be forwarded into his virtual mailbox. This uses the virtual user table to forward to a virtual user mailbox and is possible with postfix.
The old /etc/alias table is no longer suitable for most user needs and really shouldn’t be used for email forwarding and distribution beyond localhost system messages from the administrator to unix account holders. For a modern secure mail server all of the email only users should have only virtual mailboxes without real unix accounts on the system. Any aliasing should be handled in the virtual user table. Unix accounts on the system should not receive Internet mail on any address with their username. Finally, dovecot should not be allowed chroot, limited to running as a non-privileged user.