[Dovecot] local AND virtual mail locations ?

Pierre-Philipp Braun pbraun at nethence.com
Mon Aug 26 15:50:54 EEST 2013


Hi,

I would like to use Dovecot not only for virtual mboxes, but also for 
local users.  In other words, I would like to use different 
"mail_location"s depending on "passdb" "passwd-file" versus "passwd".  I 
need that as the smtp daemon I am using (david parsons' postoffice smtp 
server) serves both but is only able to process messages through 
procmail on local users.  Here are the two mail_locations I would like 
to use:

mail_location: mbox:~/mail/:INBOX=/var/mail/%u
mail_location: 
mbox:/var/spool/virtual/%d/%n.imap:INBOX=/var/spool/virtual/%d/%n

depending on those passdb stanzas, respectively:

   passdb passwd-file {
         args = username_format=%n /etc/virtual/%d/passwd
   }

   passdb passwd {
   }

Any help would be appreciated.

Here's my Dovecot version and current working configuration for virtual 
users only:

# dovecot -n
dovecot -n
# 1.2.17: /usr/local/etc/dovecot.conf
# OS: FreeBSD 8.3-RELEASE amd64  ufs
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_location: 
mbox:/var/spool/virtual/%d/%n.imap:INBOX=/var/spool/virtual/%d/%n
imap_client_workarounds: tb-extra-mailbox-sep
auth default:
   user: mail
   passdb:
     driver: passwd-file
     args: username_format=%n /etc/virtual/%d/passwd
   userdb:
     driver: static
     args: uid=6 gid=6

I find that first_valid_uid and first_valid_gid don't look pretty but it 
seems mandatory for the standard 'mail' user and group ownerships to 
work on the virtual mbox files and folders.  I created the user while 
the group already existed.  If you have any advices on that too, I would 
be pleased.

Thanks
Pierre-Philipp


More information about the dovecot mailing list