[Dovecot] migrating from mbox to maildir
Hi all, I have a locking problem in a Centos 4.4 linux machine with the following config: dovecot-0.99.11-8.EL4 postfix-2.2.10-1.1.el4
I use virtual mailboxes with postfix
currently I have dovecot with mbox as this: default_mail_env = mbox:/var/mail/virtualmail/%d/%n
The problem is that mail is being delivered to mailboxes very very slowly (sometimes up to 4 hours). In my logs, I have tons of these messages:
mail postfix/virtual[24965]: CFB8878D04F: to=REMOVED@REMOVED, relay=virtual, delay=51, status=deferred (mailbox /var/spool/mail/virtualmail/REMOVEDDOMAINNAME/npitti: unable to lock for exclusive access: Resource temporarily unavailable)
then someone told me that I need to change dovecot to maildir format. Is there a reference to change format? Or some comments about this?
Thanks in advance.
I can not help with the error, but can tell you there is a few
conversion tools for mbox to maildir format. Have a search on google.
Mark.
On 23 Nov 2007, at 18:53, "Erick Perez" eaperezh@gmail.com wrote:
Hi all, I have a locking problem in a Centos 4.4 linux machine with the following config: dovecot-0.99.11-8.EL4 postfix-2.2.10-1.1.el4
I use virtual mailboxes with postfix
currently I have dovecot with mbox as this: default_mail_env = mbox:/var/mail/virtualmail/%d/%n
The problem is that mail is being delivered to mailboxes very very slowly (sometimes up to 4 hours). In my logs, I have tons of these messages:
mail postfix/virtual[24965]: CFB8878D04F: to=REMOVED@REMOVED, relay=virtual, delay=51, status=deferred (mailbox /var/spool/mail/virtualmail/REMOVEDDOMAINNAME/npitti: unable to lock for exclusive access: Resource temporarily unavailable)
then someone told me that I need to change dovecot to maildir format. Is there a reference to change format? Or some comments about this?
Thanks in advance.
On Friday, November 23 at 01:53 PM, quoth Erick Perez:
Hi all, I have a locking problem in a Centos 4.4 linux machine with the following config: dovecot-0.99.11-8.EL4
The problem is quite likely one that was fixed in more recent versions of dovecot. Versions 0.99.x are extremely old (to the point of nearly being an entirely different product from Dovecot 1.0).
then someone told me that I need to change dovecot to maildir format. Is there a reference to change format? Or some comments about this?
Dovecot 0.99.x's Maildir support may have been better than its mbox support, but that's a bad reason to convert all your mail storage. If you update your Dovecot to a non-antique version, chances are you'll fix your problem with much less effort.
If for some reason you are completely stuck with 0.99.x, then yes, changing to Maildir format is pretty easy, and there are plenty of conversion scripts out there in the world. Just ask Google. Keep in mind if the real problem is some bug in Centos that prevents Dovecot from using locks, then the Maildir conversion may not help much, because Maildir (in Dovecot) uses locks as well.
~Kyle
Man has the right to act in conscience and in freedom so as personally to make moral decisions. "He must not be forced to act contrary to his conscience. Nor must he be prevented from acting according to his conscience, especially in religious matters." -- Catholic Catechism 1782
Kyle Wheeler wrote:
On Friday, November 23 at 01:53 PM, quoth Erick Perez:
Hi all, I have a locking problem in a Centos 4.4 linux machine with the following config: dovecot-0.99.11-8.EL4
The problem is quite likely one that was fixed in more recent versions of dovecot. Versions 0.99.x are extremely old (to the point of nearly being an entirely different product from Dovecot 1.0).
then someone told me that I need to change dovecot to maildir format. Is there a reference to change format? Or some comments about this?
Dovecot 0.99.x's Maildir support may have been better than its mbox support, but that's a bad reason to convert all your mail storage. If you update your Dovecot to a non-antique version, chances are you'll fix your problem with much less effort.
If for some reason you are completely stuck with 0.99.x, then yes, changing to Maildir format is pretty easy, and there are plenty of conversion scripts out there in the world. Just ask Google. Keep in mind if the real problem is some bug in Centos that prevents Dovecot from using locks, then the Maildir conversion may not help much, because Maildir (in Dovecot) uses locks as well.
why lock?
anyway, the problem should be solved because postfix won't need to lock the file.
On Nov 24, 2007 4:13 PM, mouss mlist.only@free.fr wrote:
Kyle Wheeler wrote:
On Friday, November 23 at 01:53 PM, quoth Erick Perez:
Hi all, I have a locking problem in a Centos 4.4 linux machine with the following config: dovecot-0.99.11-8.EL4
The problem is quite likely one that was fixed in more recent versions of dovecot. Versions 0.99.x are extremely old (to the point of nearly being an entirely different product from Dovecot 1.0).
then someone told me that I need to change dovecot to maildir format. Is there a reference to change format? Or some comments about this?
Dovecot 0.99.x's Maildir support may have been better than its mbox support, but that's a bad reason to convert all your mail storage. If you update your Dovecot to a non-antique version, chances are you'll fix your problem with much less effort.
If for some reason you are completely stuck with 0.99.x, then yes, changing to Maildir format is pretty easy, and there are plenty of conversion scripts out there in the world. Just ask Google. Keep in mind if the real problem is some bug in Centos that prevents Dovecot from using locks, then the Maildir conversion may not help much, because Maildir (in Dovecot) uses locks as well.
why lock?
anyway, the problem should be solved because postfix won't need to lock the file.
Please see my new post where I posted my dovecot.conf config file. This is my production server and I dont have a spare, so I dont want to break auth if i upgrade.
--
Erick Perez Panama Sistemas Integradores de Telefonia IP y Soluciones Para Centros de Datos Panama, Republica de Panama Cel Panama. +(507) 6694-4780
On Saturday, November 24 at 10:13 PM, quoth mouss:
If for some reason you are completely stuck with 0.99.x, then yes, changing to Maildir format is pretty easy, and there are plenty of conversion scripts out there in the world. Just ask Google. Keep in mind if the real problem is some bug in Centos that prevents Dovecot from using locks, then the Maildir conversion may not help much, because Maildir (in Dovecot) uses locks as well.
why lock?
To quote the Dovecot wiki (http://wiki.dovecot.org/MailboxFormat/Maildir):
Although maildir was designed to be lockless, Dovecot locks the
maildir while doing modifications to it or while looking for new
messages in it. This is required because otherwise Dovecot might
temporarily see mails incorrectly deleted, which would cause
trouble. Basically the problem is that if one process modifies the
maildir (eg. a rename() to change a message's flag), another
process in the middle of listing files at the same time could skip
a file. The skipping happens because readdir() system call doesn't
guarantee that all the files are returned if the directory is
modified between the calls to it. This problem exists with all the
commonly used filesystems.
~Kyle
The most important thing a father can do for his children is to love their mother. -- Fr. Theodpre Hesburgh
On Sun, 2007-11-25 at 22:56 -0600, Kyle Wheeler wrote:
On Saturday, November 24 at 10:13 PM, quoth mouss:
If for some reason you are completely stuck with 0.99.x, then yes, changing to Maildir format is pretty easy, and there are plenty of conversion scripts out there in the world. Just ask Google. Keep in mind if the real problem is some bug in Centos that prevents Dovecot from using locks, then the Maildir conversion may not help much, because Maildir (in Dovecot) uses locks as well.
why lock?
To quote the Dovecot wiki (http://wiki.dovecot.org/MailboxFormat/Maildir):
Although maildir was designed to be lockless, Dovecot locks the maildir while doing modifications to it or while looking for new messages in it. This is required because otherwise Dovecot might temporarily see mails incorrectly deleted, which would cause trouble. Basically the problem is that if one process modifies the maildir (eg. a rename() to change a message's flag), another process in the middle of listing files at the same time could skip a file. The skipping happens because readdir() system call doesn't guarantee that all the files are returned if the directory is modified between the calls to it. This problem exists with all the commonly used filesystems.
OSX with HFS+ seems to be an exception actually. Also it would be possible to use inotify to avoid skipping files.
Also Dovecot uses dotlock files, not fcntl locks, to do the maildir locking. Originally this was both because of NFS and because new dovecot-uidlist was written to the dovecot-uidlist.lock file and rename()d over. This isn't done anymore, so NFS is the only reason why dotlocks are used. I guess v2.0 could use lock_method setting to figure out if it should use fcntl/flock instead.
participants (5)
-
Erick Perez
-
Kyle Wheeler
-
Mark Adams
-
mouss
-
Timo Sirainen