[Dovecot] mbox with two storage locations

Bill Pitz bill at pitz.net
Sun Feb 24 02:20:38 EET 2008


Hello,

I'm trying to migrate a legacy system to Dovecot in which I need to 
support mbox format storage with the following parameters:

Inbox is in: /var/spool/mail/%u
Additional mail folders are stored in: /var/spool/mail2/%u  (i.e. Spam, 
Sent, Trash, Drafts, etc.)

/var/spool/mail and /var/spool/mail2 are configured with the same 
permissions.  (Read/write/execute user root, Read/write/execute group 
mail).  I've added mail as an additional group in the Dovecot 
configuration.


# dovecot --version
1.0.10

# 1.0.10: /etc/dovecot.conf
ssl_cert_file: /etc/pki/dovecot/certs/dovecot.pem
ssl_key_file: /etc/pki/dovecot/private/dovecot.pem
login_dir: /var/run/dovecot/login
login_executable: /usr/libexec/dovecot/imap-login
first_valid_uid: 100
mail_extra_groups: mail
mail_location: 
mbox:/var/spool/mail2/%u:INBOX=/var/spool/mail/%u:INDEX=MEMORY
auth default:
 passdb:
   driver: pam
 userdb:
   driver: passwd

The problem is what when I run this configuration, I am not able to see 
any of the contents of /var/spool/mail2.  I ran around with this problem 
for a while and ultimately found that the following fixes it:

cp -Rpfd /var/spool/mail2 /home

Change Dovecot to use /home/mail2/%u instead:
# 1.0.10: /etc/dovecot.conf
ssl_cert_file: /etc/pki/dovecot/certs/dovecot.pem
ssl_key_file: /etc/pki/dovecot/private/dovecot.pem
login_dir: /var/run/dovecot/login
login_executable: /usr/libexec/dovecot/imap-login
first_valid_uid: 100
mail_extra_groups: mail
mail_location: mbox:/home/mail2/%u:INBOX=/var/spool/mail/%u:INDEX=MEMORY
auth default:
 passdb:
   driver: pam
 userdb:
   driver: passwd


Further investigation revealed that no path outside of /home would work 
for the storage of the mbox directory.  Any ideas?  Everything seems to 
work great except for this one (pretty major) issue.

Also, /home, /var, and / are separate filesystems.  I'm not sure if 
that's playing into this or not (doesn't seem like it, since it seems to 
have no issue storing INBOX in /var/spool/mail).


Thanks,

-Bill



More information about the dovecot mailing list