[Dovecot] maildir location
Hello,
I am trying to use dovecot (v. 2.0.11) and postfix (v. 2.7.3) together. The email server is an ldap client and user's home directories on NFS server are mounted using autofs.
As I understand, Maildir performance is better than mbox type, so I'd like to use Maildir instead of mbox.
However, when I checked conf.d/10-mail.conf file, there is mail_location = maildir:~/.maildir already configured in it which means user's email will reside in their home directories on the NFS server rather than being on Email server's local storage where plenty of space is available. I anticipate due to NFS there will again be a performance hit .
Question : Can I change mail_location for maildir to be somewhere other than ~/.maildir. ( like /var/mail/%u/Maildir, where /var/mail is local storage). There are about 200 ldap users who will be using this email server through squirrel-mail or access them through email clients.
By the way, I am confused about one setting in postfix : home_mailbox = .maildir/ in main.cf . Does this really play any role? If so, which parameter should be changed and to what and with what permissions to the new directory.
Hope I was able to explain, if not please let me know for more details..
Thanks, U
On Thu, 2011-03-17 at 11:19 -0500, upen wrote:
Sure.
If Postfix delivers the mails, rather than Dovecot LDA, then yes you'll need to configure Postfix also to deliver correctly. Maybe it would be easier to just switch to Dovecot LDA: http://wiki2.dovecot.org/LDA
Thanks Timo for quick confirmation and the link for setting up dovecot as LDA.
I made below changes to postfix's main.cf
mailbox_command = /usr/libexec/dovecot/dovecot-lda ( verified that's correct location for file)
postfix reload
The changed mail_location as mail_location = maildir:/localdir/mail/%u
dovecot restart
/var/log/messages shows, below error,
dovecot: pop3(username): Error: user username: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/localdir/mail/username) failed: Permission denied (euid=1002(username) egid=10(wheel) missing +x perm: /localdir/mail, euid is not dir owner)
Any idea what is going wrong?
On Thu, Mar 17, 2011 at 12:01 PM, upen <upendra.gandhi@gmail.com> wrote:
Changed permissions on root directories, don't know if this is secure or not but it worked. I see cur, tmp, new and other files created under local storage now.
Set permissions as below,
#ls -ald /localdir drwxrwxrwx 31 root root 12288 Mar 17 10:48 /localdir/
ls -ald /localdir/mail
drwxrwxrwx 3 dovecot dovecot 4096 Mar 17 10:49 /localdir/mail
mkdir /localdir/mail/username chown username:group /localdir/mail/username chmod 700 /localdir/mail/username
Do you think it is okay to keep these perms ?
On 17/03/11 12:19 PM, upen wrote:
If you expect to have any folders with lots of messages, I would use mdbox rather than Maildir. NFS tends to have performance problems with lots of small files, and Maildir uses one file per message, where mdbox has a sort of compromise between lots of files and the huge files that mbox creates.
Thanks Patrick.
OK. back to zero again. Now this is new piece of information for me which tell me that mdbox is better than Maildir format for emails on NFS.
Question: Which is best format to go with in general, maildir or mdbox? . We really don't want users to use their NFS HOME directories for storing and accessing their emails. Even if they create any imap folder that should also get created on email server's local storage either in Maildir format or the new format mdbox which I've just heard about.
participants (4)
-
Jim Knuth
-
Patrick McLean
-
Timo Sirainen
-
upen