[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:
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).
Sure.
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.
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
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:
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?
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 Thu, 2011-03-17 at 12:41 -0500, upen wrote:
#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 ?
At least you should do chmod +t /localdir /localdir/mail.
Or just keep them 0755 and create /localdir/mail/username with proper permissions immediately for new users.
On 17/03/11 12:19 PM, upen wrote:
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.
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.
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.
am 17.03.11 22:33 schrieb upen upendra.gandhi@gmail.com:
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.
really? Only for 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.
-- Mit freundlichen Grüßen, Jim Knuth
P.S.: Bitte senden Sie KEINE HTML-Mails! ##### Zufallszitat: Der Gewissensbiss ist unanständig. [Nietzsche]
On Thu, Mar 17, 2011 at 4:59 PM, Jim Knuth jk@jkart.de wrote:
am 17.03.11 22:33 schrieb upen upendra.gandhi@gmail.com:
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.
really? Only for NFS?
No I don't know I want to know which is best performance mail format for local storage of emails now that I read that mdbox performs better in NFS environment.
Thanks.
On 17/03/11 05:59 PM, Jim Knuth wrote:
am 17.03.11 22:33 schrieb upen upendra.gandhi@gmail.com:
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.
really? Only for NFS?
Not necessarily only for NFS, but NFS's performance hit with lots of files is more egregious than local filesystems.
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