[Dovecot] Splitting up mail_location setting?

Timo Sirainen tss at iki.fi
Tue Feb 1 18:35:22 EET 2011


mail_location setting has started becoming a bit bloaty. I'm not
actually even sure why I've kept adding more parameters to it rather
than just adding new settings. It's also caused confusion, because
people try things like:

mail_location = mbox:/var/mail/%u
mail_location = mbox:INBOX=/var/mail/%u

Although the first one has been giving ok enough error message for a
long time now and the second one also will give in v2.0.10, it still
would be nicer if there wasn't any need for such confusion at all. The
settings could instead be:

mail_format = mbox
mail_inbox_path = /var/mail/%u

Then Dovecot could complain about mail_root_path being empty, which
would be more understandable..

The mail_location setting itself would keep working probably forever for
backwards compatibility (and also in some setups it would be difficult
to split it when it comes from LDAP/SQL), although some of its
parameters could maybe be dropped after a while (SUBSCRIPTIONS, DIRNAME,
MAILBOXDIR). So if you did e.g.:

mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_root_path = ~/mail2

The result would be same as mbox:~/mail2:INBOX=/var/mail/%u. Although
this can also result in probably unwanted situation:

mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_format = maildir
mail_root_path = ~/Maildir

Now the result would be maildir:~/Maildir:INBOX=/var/mail/%u. This can
be avoided by setting mail_inbox_path="" explicitly. Or the other way
around:

mail_inbox_path = /var/mail/%u
mail_location = maildir:~/Maildir:INBOX=

Without the INBOX= the mail_inbox_path would be in use.

Below are the setting names I thought about using:

a) mail_location = maildir:~/Maildir:INBOX=~/Maildir/.INBOX:INDEX=~/indexes:CONTROL=~/control:LAYOUT=fs:SUBSCRIPTIONS=courier-subscriptions

mail_format = maildir
mail_root_path = ~/Maildir
mail_inbox_path = ~/Maildir/.INBOX
mail_index_path = ~/indexes
mail_control_path = ~/control
mail_directory_layout = fs
mail_subscriptions_fname = courier-subscriptions

b) mail_location = mdbox:~/mdbox:ALT=/alt/%u:LAYOUT=fs:DIRNAME=dbox-Mails:MAILBOXDIR=mailboxes

mail_format = mdbox
mail_root_path = ~/mdbox
mail_alt_path = /alt/%u
mail_dir_name = dbox-Mails
mail_mailboxes_dir_name = mailboxes

Thoughts?



More information about the dovecot mailing list