What is the correct way to configure the mail_location option for Mailidr format?

deoren Dovecot-mailing-list at whyaskwhy.org
Tue Oct 21 16:18:07 UTC 2014

Short version:

What is the correct way to configure the mail_location option for 
Mailidr format?

I've long had it setup this way:

     mail_location = maildir:/var/vmail/%d/%n

based on this guide:


Is that correct?

Longer version:

After upgrading from Dovecot v2.0.x to v2.2.x yesterday I'm coming to 
the conclusion that I've got it configured wrong. This is probably 
compounded by my bright idea of explicitly setting the path separator 
prior to the upgrade like so:

separator = .

Because we're using Maildir I thought it would be useful to explicitly 
set the separator value to what the default is for Maildir. I figured 
this would be a good way to remind myself what the separator is by 
default. I also figured while I was merging the conf changes between 
v2.0 and v2.2 I could roll that additional change in also. Looks like 
that was a bad idea to include unnecessary changes until things had 
stabilized. I should know better; I was too optimistic for my own good.

Here is an example error message I ran into:

     stat(/var/vmail/example.com/username/.dovecot.lda-dupes/tmp) failed: 
Not a directory

which is nearly identical (other than leading path) to what is shown 


Steffen Kaiser responded with, "You should not (must not) have home == 
maildir root." That is when I double-checked the guide that I mentioned 
above and found that I had followed their directions exactly for that 
conf setting. Looking at some other guides/tutorials shows something 
more like:

     mail_location = maildir:/var/vmail/%d/%n/Maildir

I assume the latter is how it's supposed to be done? If so, that would 
explain the problems I've had with Sieve scripts in the past until I 
explicitly set 'sieve_dir' like so:

     sieve_dir = /var/vmail/sieve/%d/%n/sieve_dir

I did review the official docs here:


but I didn't find where it explicitly warns against setting home == 
maildir root. It should probably be apparent, but it wasn't to me when I 
first configured that setting.

Thanks in advance for your help. If it turns out that the linode.com 
guide is wrong I'll create a Pull request to have that guide updated.

More information about the dovecot mailing list