I just finished setting up a Postfix SMTP and Dovecot IMAP/POP3 server.
It works perfectly fine for virtual users both sending and receiving, but I need to do the following:
Besides virtual users being able to retrieve mail, I want to be able to retrieve local users' mail too.
So, that would be getting mail from /home/[user]/Maildir
Currently Dovecot users are stored in a file in the format [user@domain]:[pass]:[uid]:[gid]
Could I somehow add local users to that file too? (I tried already, but setting the home directory does not prevent Dovecot from resolving to virtual directory, rather than /home/[user]/Maildir
.)
How can I retrieve both Dovecot users' mails as well as local users' mail?
Best Answer
Yes, you can mix & match local & virtual users. I have that. Here is the settings for local users in
auth-system.conf.ext
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 the10-mail.conf
file for local users:And I change it for virtual users in
auth-passwdfile.conf.ext
:See the various tutorials for the different types: http://wiki2.dovecot.org/HowTo
You can also set these to yes in
dovecot.conf
andtail
/var/log/dovecot*
to see what type of user it thinks it is.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.