Hi,
First of all, I want to say thanks to the author of the Email with Postfix, Dovecot, and MySQL guide. It was easy to follow and got me started on the road from Dovecot + local system users setup to one where I can easily manage users through a database. I've since been able to customize and tweak the setup to fit all of my needs.
That said, there is an issue with the guide that didn't bite me until I upgraded to Dovecot 2.2.x about a week ago. I've since learned that it is a bad idea to have the mail_location
set to the same location as the virtual user's home
directory:
Quoting the official Home Directories for Virtual Users Dovecot wiki page:
Home vs. mail directory
Home directory shouldn't be the same as mail directory. It's possible to do that, but you might run into trouble with it sooner or later.
So with the guide directing the reader to configure their setup like so:
userdb {
driver = static
args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
}
mail_location = maildir:/var/mail/vhosts/%d/%n
The user will have their Maildir content dumped right into the root of their Dovecot home directory.
Some additional back & forth on the Dovecot mailing list (in case it's useful):
In my case when I used doveadm expunge
from a cron job prior to the upgrade I didn't have any problems. It was only after the upgrade from v2.0.19 (default in Ubuntu 12.04 LTS) to v2.2.x that doveadm threw errors about finding .dovecot.lda-dupes
files in the home directory for some of our virtual user's.
It didn't turn out to be anything serious from what I can tell, but it was enough to highlight that worse could happen at some point due to the configuration I was using. I propose that the guide be modified to recommend this configuration instead:
userdb {
driver = static
args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
}
mail_location = maildir:~/Maildir
The userdb
setting would stay the same, but the setting for mail_location
would be changed from a static value to one that inherits the virtual user's home directory and places mail into a subdirectory. This would match the recommended values in the Dovecot configuration and should prove a safer set of default values for readers to adopt.
Looking over these guides it appears they use this same setup:
and while they're not linked from the main Linode site (at least I didn't see them), the older guides that I found in the repo appear to also have the correct values:
- Debian 5
- Debian 6
- Ubuntu 9.10
- Ubuntu 10.04
- Ubuntu 10.10
These appear to have incorrect values:
I'm not very familiar with Git or GitHub, but I was going to modify the source for the guide I used and the troubleshooting guide to show mail_location
using the value that I mentioned above. Assuming that it would be accepted, how should I go about making a Pull request? Is there a preference on having one request per guide or should both be included in one request?
Thanks.