Timo, On Tue, Mar 12, 2019, at 3:56 AM, Timo Sirainen via dovecot wrote:> On 10 Mar 2019, at 10.14, Kostya Vasilyev via dovecot <dovecot at dovecot.org> wrote: >> >> My mail is stored under ~/mail/.imap (not sure what this format is called), I mean not "single file mbox". >> >> I have not changed any IDLE related config settings: >> >> doveconf | grep -i idle >> default_idle_kill = 1 mins >> director_ping_idle_timeout = 30 secs >> imap_idle_notify_interval = 2 mins >> imapc_max_idle_time = 29 mins >> mailbox_idle_check_interval = 30 secs >> >> What can I do to make Dovecot notify IDLE clients about flags changes - more quickly? Preferably near-instant? > > It should simply just work, assuming there aren't any weird inotify limits, but you should get errors logged about reaching those. You could see if it makes any difference to set mailbox_idle_check_interval=1s >mailbox_idle_check_interval = 1 secs did not help Here is an interesting case - Let's say I have my IDLE connection. - Connection "A" - an email app where I set or clear \Flagged on two messages. The IDLE connection is silent (no unsolicited notifications about these flags). - Connection "B" - an email app where I do a refresh - it does a SELECT (CONDSTORE) followed by FETCH UID FLAGS CHANGEDSINCE (because it sees that there are only flags changes). ---> the IDLE connection is notified about flags changes immediately right as Connection "B" is pulling its changes. I tried a direct network connection (netcat) instead of Connection "B" and the actual trigger is SELECT (CONDSTORE). - Start up IDLE connection - Use Connection "A" to make flags changes ( IDLE connection is silent ) - Use a netcat connection to SELECT (CONDSTORE) Dovecot flushes flags to the IDLE connection immediately - Doing SELECT (without CONDSTORE) does not Looks like some sort of bug in Dovecot related to CONDSTORE? This can probably be reproduced with several direct network connections using netcat / openssl s_client - and CONDSTORE seems to be an important part of the scenario. Ideas? -- K -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190312/5b532d43/attachment-0001.html>
One more data point Timo: On Tue, Mar 12, 2019, at 9:58 AM, Kostya Vasilyev via dovecot wrote:> Timo, > > On Tue, Mar 12, 2019, at 3:56 AM, Timo Sirainen via dovecot wrote: >> On 10 Mar 2019, at 10.14, Kostya Vasilyev via dovecot <dovecot at dovecot.org> wrote: >>> >>> My mail is stored under ~/mail/.imap (not sure what this format is called), I mean not "single file mbox". >>> >>> I have not changed any IDLE related config settings: >>> >>> doveconf | grep -i idle >>> default_idle_kill = 1 mins >>> director_ping_idle_timeout = 30 secs >>> imap_idle_notify_interval = 2 mins >>> imapc_max_idle_time = 29 mins >>> mailbox_idle_check_interval = 30 secs >>> >>> What can I do to make Dovecot notify IDLE clients about flags changes - more quickly? Preferably near-instant? >> >> It should simply just work, assuming there aren't any weird inotify limits, but you should get errors logged about reaching those. You could see if it makes any difference to set mailbox_idle_check_interval=1s >> > > mailbox_idle_check_interval = 1 secs > > did not help > > Here is an interesting case > > - Let's say I have my IDLE connection. > > - Connection "A" - an email app where I set or clear \Flagged on two messages. > > The IDLE connection is silent (no unsolicited notifications about these flags). > > - Connection "B" - an email app where I do a refresh - it does a SELECT (CONDSTORE) followed by FETCH UID FLAGS CHANGEDSINCE (because it sees that there are only flags changes). > > ---> the IDLE connection is notified about flags changes immediately right as Connection "B" is pulling its changes. > > I tried a direct network connection (netcat) instead of Connection "B" and the actual trigger is SELECT (CONDSTORE). > > - Start up IDLE connection > > - Use Connection "A" to make flags changes > > ( IDLE connection is silent ) > > - Use a netcat connection to SELECT (CONDSTORE) > > Dovecot flushes flags to the IDLE connection immediately > > - Doing SELECT (without CONDSTORE) does not > > Looks like some sort of bug in Dovecot related to CONDSTORE? > > This can probably be reproduced with several direct network connections using netcat / openssl s_client - and CONDSTORE seems to be an important part of the scenario. > > Ideas? > > -- KIt makes no difference if the IDLE connection does SELECT or SELECT (CONDSTORE) prior to going IDLE. But then as far as I know (?) - in Dovecot, once any connection uses CONDSTORE ever, even once, Dovecot creates data structures to track MODSEQ values, and those data structures are forever. -- K -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190312/760eabd9/attachment.html>
On 12 Mar 2019, at 10.21, Kostya Vasilyev via dovecot <dovecot at dovecot.org> wrote:> > It makes no difference if the IDLE connection does SELECT or SELECT (CONDSTORE) prior to going IDLE. > > But then as far as I know (?) - in Dovecot, once any connection uses CONDSTORE ever, even once, Dovecot creates data structures to track MODSEQ values, and those data structures are forever.So are you saying that you can reproduce if you do for a completely new user: doveadm exec imap -u testuser1 a select inbox b idle And then run: echo foo | doveadm save -u testuser1 doveadm flags add -u testuser1 '\Seen' mailbox inbox 1 And the EXISTS shows up immediately after saving, but the flag change won't show up? It works fine with me. Do you see any errors in "doveadm log errors"? Can you reproduce this if you try with some other mailbox format than mbox? -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190312/3849e81b/attachment.html>