[Dovecot] IDLE with inotify problem
Hi,
I recently switched from courier imap to dovecot. With courier I had
a working IDLE setup that informed me immediately when new mail
arrived. With Dovecot it is different, sometimes i get an immediate
result but most of the time it takes a rather long time for the
notification to return to the client.
For testing purposes I set mailbox_idle_check_interval = 1 and i now
get the same behaviour as with couier (a new mail immediately causes
a notification) but i am not sure that this is the right solution.
Reading the comments in the config files I was under the impression
that this is not needed if dovecot uses inotify.
Setup: Kernel 2.6.22.1 with inotify
dovecot 1.0.3 from debian unstable Build options: ioloop=epoll notify=inotify ipv6 openssl
So my question is can I check that dovecot is actually using inotify?
Kind regards, Michael
On Aug 12, 2007, at 11:20 AM, Michael Guntsche wrote:
So my question is can I check that dovecot is actually using inotify?
Which brings me to another question for Timo..
Running Dovecot 1.0.3 on OS X 10.4.10 here. Which --with-notify
compile time option would you suggest? dnotify, inotify, kqueue, or
none.
P.S. The version of 1.0.3 that we're currently running was compiled
without a "with-notify" instruction. It still appears to implement
some form of idle / notify. We've tested with Thunderbird and
Apple's Mail.app (with imap-idle-plugin installed). Even though both
clients have been set NOT to check mail on an interval we are still
notified when mail arrives.
B. Bodger
On Aug 12, 2007, at 18:33, Bruce Bodger wrote:
On Aug 12, 2007, at 11:20 AM, Michael Guntsche wrote:
So my question is can I check that dovecot is actually using inotify?
Which brings me to another question for Timo..
Running Dovecot 1.0.3 on OS X 10.4.10 here. Which --with-notify
compile time option would you suggest? dnotify, inotify, kqueue,
or none.
You should use kqueue under macosx since dnotify and inotify are
linux only.
Kind regards, Michael
On Aug 12, 2007, at 1:00 PM, Michael Guntsche wrote:
Running Dovecot 1.0.3 on OS X 10.4.10 here. Which --with-notify
compile time option would you suggest? dnotify, inotify, kqueue,
or none.You should use kqueue under macosx since dnotify and inotify are
linux only.
Thanks for that, Mike! Adding --with-notify=kqueue made a world of
difference here! Really appreciate the advice.
B. Bodger
On Sun, 2007-08-12 at 17:20 +0200, Michael Guntsche wrote:
Hi,
I recently switched from courier imap to dovecot. With courier I had
a working IDLE setup that informed me immediately when new mail
arrived. With Dovecot it is different, sometimes i get an immediate
result but most of the time it takes a rather long time for the
notification to return to the client. For testing purposes I set mailbox_idle_check_interval = 1 and i now
get the same behaviour as with couier (a new mail immediately causes
a notification) but i am not sure that this is the right solution.
Reading the comments in the config files I was under the impression
that this is not needed if dovecot uses inotify.
What IMAP client do you use? Currently Dovecot works like:
- IDLE starts
- if maildir changes, the new changes are reported immediately
- if client doesn't break from IDLE, continue..
- if maildir changes before maildir_idle_check_interval seconds, wait
This works nicely if client breaks from IDLE, but it looks like nowadays some clients just use multiple connections where one is always in IDLE. So maybe I'll have to change that.
On Aug 13, 2007, at 13:49, Timo Sirainen wrote:
What IMAP client do you use? Currently Dovecot works like:
- IDLE starts
- if maildir changes, the new changes are reported immediately
- if client doesn't break from IDLE, continue..
- if maildir changes before maildir_idle_check_interval seconds, wait
This works nicely if client breaks from IDLE, but it looks like
nowadays some clients just use multiple connections where one is always in
IDLE. So maybe I'll have to change that.
I am using the inotify plugin bundle for mail.app most of the time
and I tested it via a telnet connection too.
As far as i know the imap-idle-plugin opens a seconds connection and
keeps it in idle state.
This might explain why i see the current behaviour with it and my
telnet tests.
First notification happens immediately and if the client does not
break from IDLE it just waits for maildir_idle_check_interval
seconds. Maybe this can be changed that it does not take the interval
into account of it uses inotify, dnotify or kqueue.
My workaround for now is to set the timeout to 1.
Kind regards, Michael
Hello Timo,
On Aug 13, 2007, at 14:15, Michael Guntsche wrote:
Maybe this can be changed that it does not take the interval into
account of it uses inotify, dnotify or kqueue. My workaround for now is to set the timeout to 1.
I thought about a simple way to implement this. mailbox_notify_changes() wants an interval so why not change cmd- idle.c to something like.
cmd-idle.c:252 #ifdef IOLOOP_NOTIFY_NONE str = getenv("MAILBOX_IDLE_CHECK_INTERVAL"); interval = str == NULL ? 0 : (unsigned int)strtoul(str, NULL, 10); if (interval == 0) interval = DEFAULT_IDLE_CHECK_INTERVAL; #else interval = 1; #endif
So all other notifies just default to an interval of 1 and ignore the
setting in the config file.
Kind regards, Michael
On Aug 13, 2007, at 13:49, Timo Sirainen wrote:
What IMAP client do you use? Currently Dovecot works like:
- IDLE starts
- if maildir changes, the new changes are reported immediately
- if client doesn't break from IDLE, continue..
- if maildir changes before maildir_idle_check_interval seconds, wait
This works nicely if client breaks from IDLE, but it looks like
nowadays some clients just use multiple connections where one is always in
IDLE. So maybe I'll have to change that.
Hello Timo,
Just for my information, are you planning to do something about this
special issue in 1.1 or will this happen in a later version?
Kind regards, Michael
On Tue, 2007-08-14 at 22:03 +0200, Michael Guntsche wrote:
On Aug 13, 2007, at 13:49, Timo Sirainen wrote:
What IMAP client do you use? Currently Dovecot works like:
- IDLE starts
- if maildir changes, the new changes are reported immediately
- if client doesn't break from IDLE, continue..
- if maildir changes before maildir_idle_check_interval seconds, wait
This works nicely if client breaks from IDLE, but it looks like
nowadays some clients just use multiple connections where one is always in
IDLE. So maybe I'll have to change that.Hello Timo,
Just for my information, are you planning to do something about this
special issue in 1.1 or will this happen in a later version?
Hmm. I guess this could be changed to v1.0 as well:
On Sep 22, 2007, at 16:55, Timo Sirainen wrote:
On Tue, 2007-08-14 at 22:03 +0200, Michael Guntsche wrote: Hmm. I guess this could be changed to v1.0 as well:
Hi Timo,
Just installed a patched 1.0.5 version and it works like a charm now.
Thank you for the fix.
Kind regards, Michael
participants (4)
-
Bruce Bodger
-
Johannes Berg
-
Michael Guntsche
-
Timo Sirainen