Postfix with Dovecot: local and virtual users

Yes, you can mix & match local & virtual users. I have that. Here is the settings for local users in auth-system.conf.ext

passdb {
  driver = pam
  args = failure_show_msg=yes
}

userdb {
  driver = passwd
}

http://wiki2.dovecot.org/SystemUsers

You can change the mail directory for a type of user by putting it into the userdb section. This is my mail_location in the 10-mail.conf file for local users:

mail_location = mbox:~/mail/:INBOX=/var/mail/%u

And I change it for virtual users in auth-passwdfile.conf.ext:

passdb {
  driver = passwd-file
  args = /etc/dovecot/passwd
}
userdb {
  driver = static
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n mail=maildir:/var/mail/vhosts/%d/%n
}

See the various tutorials for the different types: http://wiki2.dovecot.org/HowTo

You can also set these to yes in dovecot.conf and tail /var/log/dovecot* to see what type of user it thinks it is.

#auth_verbose = yes
#auth_debug = yes

I also want to add, which isn't obvious when reading the docs, that Postfix delivers all mail to a single file for each user. However, Dovecot requires multiple files and directories for Sent, Trash, Drafts, etc. These can be in the same or totally different locations. Sometimes mail is delivered to /var/mail, and sometimes to ~/mail. The Dovecot (IMAP) folders can be in the user's home directory for system users, but what about virtual users? They either share a home directory or all their folders go into /var/vmail.