[Dovecot] local AND virtual mail locations ?

Pierre-Philipp Braun pbraun at nethence.com
Mon Sep 2 20:47:33 EEST 2013


> Well, first of all, why are you using mbox?
> 
> truncated output from my doeveconf -n
> 
> # for Local users
> mail_location = maildir:~/Maildir
> 
> For SQL users
> userdb {
>   args = /etc/dovecot/dovecot-sql.conf.ext
>   default_fields = uid=vpopmail gid=vchkpw mail_location=/usr/local/virtual/%u
>   driver = sql
> }
> 
> Notice that using default_fields I am able to respecify the mail_location for the sql users. You should be able to do something similar, right?
> 
> Of course, you are using dovecot 1.x, so maybe it's more difficult?
> 
> Still, mbox is bad. No one should use mbox.

Ok I've switched to Dovecot version 2 which indeed allows to use a per 
userdb mail location (mail= instead of mail_location).  As for maildir 
versus mbox I was able to turn to maildir for the local users which 
messages are delivered by procmail.  For the virtual users, 
unfortunately for now, my smtp daemon, postoffice smtpd, is only mbox 
capable with no alternate LDA possibility.

# 2.2.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.3-RELEASE amd64
disable_plaintext_auth = no
first_valid_gid = 6
first_valid_uid = 6
mail_privileged_group = mail
passdb {
   args = *
   driver = pam
}
passdb {
   args = username_format=%n /etc/virtual/%d/passwd
   driver = passwd-file
}
protocols = imap
service auth {
   user = root
}
ssl = no
userdb {
   args = blocking=yes
   driver = passwd
   override_fields = mail=maildir:~/Maildir/
}
userdb {
   args = uid=mail gid=mail
   driver = static
   override_fields = 
mail=mbox:/var/spool/virtual/%d/%n.imap/:INBOX=/var/spool/virtual/%d/%n
}
protocol imap {
   imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
}

Thanks to all!



More information about the dovecot mailing list