[Dovecot] specifying INBOX with maildir for mail_location

Post Master postmaster at psy.miami.edu
Fri Dec 8 00:58:01 UTC 2006


Whew!!!  Thank goodness that works!  Although I'm a little surprised 
that it does.  By my reading of the documentation, the INBOX: part of 
mail_location (default_mail_env) is used specifically for mbox mail 
stores because mbox files cannot have both messages and directories, 
making it necessary to somehow distinguish the INBOX mbox containing the 
messages from the mbox listing the folders on the server.

I was actually expecting the answer to be something like, "can't be done 
using mail_location for maildir.  The only way to store mail seperately 
is to create a second private namespace something like:"

mail_location = 
maildir:/data/fast/%Ld/mail/%Ln:INDEX=/data/fast/%Ld/indices/%Ln

namespace private {
   separator = /
   prefix =
   inbox = yes
   hidden = yes
}

namespace private {
   separator = /
   prefix = "archives/"
   location = maildir:/data/deep/%Ld/mail/%Ln
}

"and train your users how to use it."  Incidentally, this answer would 
work as well wouldn't it?  Would this provide "archives" at the same 
level as Inbox in a namespaces aware email client with the ability to 
create folders under "archives" that would be stored seperately from 
folders created outside of "archives"?

Just for completeness, is there an officially sanctioned way of 
configuring dovecot to store certain arbitrary maildir folders in 
specific separate locations?

Thanks very much for your help.

Dirk Essl wrote:
> Post Master wrote:
>> I'd like to store all of my mail in maildir, but I want to store the 
>> inbox and indices on fast storage and everything else on deep storage. 
>> Does the following configuration value for mail_location accomplish this?
>>
>> mail_location = 
>> maildir:/data/deep/%Ld/mail/%Ln:INBOX=/data/fast/%Ld/mail/%Ln:INDEX=/data/fast/%Ld/indices/%Ln 
>>
> 
> I have the following setup:
> 
> default_mail_env = 
> maildir:/var/maildir/%u/:INBOX=/var/mail/inboxes/%u/:INDEX=/var/mail/indexes/%u/index 
> 
> 
> /var/maildir is a nfs mounted directory on a filer
> /var/mail is local
> 
> I'm running rc2, so maybe default_mail_env is now named mail_location
> 
> in this case, you don't need a specific namespace setup.
> 
> for compatibility reasons for clients which have a 'Imap Directory' 
> setting my namespaces ook like this:
> 
> 
> namespace private {
>   separator = /
>   prefix =
>   inbox = yes
> }
> 
> namespace private {
>   separator = /
>   prefix = ~/MailImap/
>   hidden = yes
> }
> 
> namespace private {
>   separator = /
>   prefix = /home/%u/MailImap/
>   hidden = yes
> }
> 
> namespace private {
>   separator = /
>   prefix = ~/mailIMAP/
>   hidden = yes
> }
> 
> 
>> ------------------------------------------------------------------------
>> If not, does the following configuration accomplish this with namespaces?
>>
>> mail_location = 
>> maildir:/data/fast/%Ld/mail/%Ln:INDEX=/data/fast/%Ld/indices/%Ln
>>
>> namespace private {
>>   separator = /
>>   inbox = yes
>>   hidden = yes
>>   prefix =
>>   location =
>> }
>>
>> namespace private {
>>   separator = /
>>   hidden = yes
>>   prefix = ???
>>   location = maildir:/data/deep/%Ld/mail/%Ln/???
>> }
>>
>> ------------------------------------------------------------------------
>> Actually, I can't quite finish the namespace configuration.  I'd like 
>> to set something like:
>>
>>   prefix = *
>>   location = maildir:/data/deep/%Ld/mail/%Ln
>>
>> But I suspect the '*' won't actually match everything, and even if it 
>> did, I suppose it would also match the inbox.  I began with listing 
>> any and every typical folder in its own namespace like:
>>
>> namespace private {
>>   separator = /
>>   hidden = yes
>>   prefix = drafts
>>   location = maildir:/data/deep/%Ld/mail/%Ln/drafts
>> }
>>
>> namespace private {
>>   separator = /
>>   hidden = yes
>>   prefix = templates
>>   location = maildir:/data/deep/%Ld/mail/%Ln/templates
>> }
>>
>> namespace private {
>>   separator = /
>>   hidden = yes
>>   prefix = sent
>>   location = maildir:/data/deep/%Ld/mail/%Ln/sent
>> }
>>
>> and so on, but that doesn't seem very elegant.  Also, namespaces scare 
>> me for client compatibility.  Am I missing something obvious?
>>
> 
> the prefix setting is not for defining which folder is where, prefix 
> defines where dovecot will look for mail, if a client has the 'Imap 
> Server Directory' set to this value.
> 
> 
> regards
> dirk


More information about the dovecot mailing list