[Dovecot] local AND virtual mail locations ?

Pierre-Philipp Braun pbraun at nethence.com
Fri Aug 30 21:52:30 EEST 2013


Quoting /dev/rob0 30/08/2013 17:11,
> You posted today that it must not be possible to serve both virtual 
> and system users on a single Dovecot instance. This is wrong.

I don't say it is impossible, I'm just saying it isn't as trivial as you 
supposed in your first answer.  In fact, I got it _almost_ working, the 
only  quirk is about mail_location parameter being shared among all 
kinds of users, local and virtual, which causes the troubles I try to 
explain hereby.

When I use,
     mail_location = mbox:~/
* YES this is the best way, afaict, to get the mboxes within the userdb 
defined home= variable *
the problems are:
1) local users' home dir is served, which is not appropriate as I want 
them to have other files, not only emails, especially the ~/.forward file,
2) I need to setup the smtp daemon or its LDA to write to local users' 
~/inbox or make a link to /var/(spool/)mail/%u.  Otherwise the local 
users don't get any INBOX as the :INBOX= part is missing in the 
mail_location declaration.
(everything is fine for virtual users)

When I use,
     mail_location = mbox:~/mail/
the problems are:
1) I have to create the 'mail/' folder in virtual users' imap folder and 
move the content to it for every virtual user,
2) I need to setup the smtp daemon or its LDA to write to local users' 
~/mail/inbox or make a link to /var/(spool/)mail/%u.  Otherwise the 
local users don't get any INBOX either as the :INBOX= part is missing in 
the mail_location declaration.

When I use,
     mail_location = mbox:~/mail/:INBOX=/var/mail/%u
it just won't work as the virtual and local users don't share the same 
locations for inboxes and this cannot be set with the userdb home= trick.

So here is it, finally (still got the ssl part to fix).  I am probably 
going to use the second mail_location possibility, it just bothers me to 
add a useless folder to virtual users' mail path 
(/var/spool/virtual/domain/username.folder/*mail/*).

# dovecot -n
# 1.2.17: /usr/local/etc/dovecot.conf
# OS: FreeBSD 8.3-RELEASE amd64
protocols: imap
ssl: no
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
first_valid_uid: 6
first_valid_gid: 6
mail_privileged_group: mail
mail_location: mbox:~/mail/
imap_client_workarounds: delay-newmail netscape-eoh tb-extra-mailbox-sep
auth default:
   username_format: %Lu
   passdb:
     driver: pam
     args: *
   passdb:
     driver: passwd-file
     args: username_format=%n /etc/virtual/%d/passwd
   userdb:
     driver: passwd
     args: blocking=yes
   userdb:
     driver: static
     args: uid=mail gid=mail home=/var/spool/virtual/%d/%n.imap


option as I didn't couldn't find

Pierre-Philipp


More information about the dovecot mailing list