<!DOCTYPE html><html><head><title></title><style type="text/css">#fastmail-quoted p.fastmail-quoted-MsoNormal,#fastmail-quoted  p.fastmail-quoted-MsoNoSpacing{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}
#fastmail-quoted p.fastmail-quoted-MsoNormal,#fastmail-quoted  p.fastmail-quoted-MsoNoSpacing{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Timo,<br></div><div><br></div><div>On Wed, Mar 13, 2019, at 9:36 AM, Kostya Vasilyev wrote:<br></div><blockquote type="cite" id="fastmail-quoted"><div>Timo,<br></div><div><br></div><div>On Wed, Mar 13, 2019, at 12:39 AM, Timo Sirainen wrote:<br></div><blockquote type="cite" id="fastmail-quoted-fastmail-quoted"><div>On 12 Mar 2019, at 10.21, Kostya Vasilyev via dovecot <<a class="fastmail-quoted-fastmail-quoted-" href="mailto:dovecot@dovecot.org">dovecot@dovecot.org</a>> wrote:<br></div><div><blockquote class="fastmail-quoted-fastmail-quoted-" type="cite"><div><br></div><div class="fastmail-quoted-fastmail-quoted-"><div class="fastmail-quoted-fastmail-quoted-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-style:initial;text-decoration-color:initial;">It makes no difference if the IDLE connection does SELECT or SELECT (CONDSTORE) prior to going IDLE.<br></div><div class="fastmail-quoted-fastmail-quoted-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-style:initial;text-decoration-color:initial;"><br></div><div class="fastmail-quoted-fastmail-quoted-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-style:initial;text-decoration-color:initial;">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.<br></div></div></blockquote></div><div>So are you saying that you can reproduce if you do for a completely new user:<br></div><div><br></div><div>doveadm exec imap -u testuser1<br></div><div>a select inbox<br></div><div>b idle<br></div><div><br></div><div>And then run:<br></div><div>echo foo | doveadm save -u testuser1<br></div><div>doveadm flags add -u testuser1 '\Seen' mailbox inbox 1<br></div><div><br></div><div>And the EXISTS shows up immediately after saving, but the flag change won't show up? It works fine with me.<br></div><div><br></div><div>Do you see any errors in "doveadm log errors"? Can you reproduce this if you try with some other mailbox format than mbox?<br></div><div><br></div></blockquote><div><br></div><div>1 - Yes I was able to reproduce with a completely new user.<br></div><div><br></div><div>I didn't use your doveadm commands above, but created a new Linux user in group mail, set a password in /etc/dovecot/users, and sent a few emails to that user from another mail account / web mail. My SMTP server is Postfix.<br></div><div><br></div><div>Then I used my IDLE client code (which does SELECT CONDSTORE) and a separate netcat connection to make flags changes.<br></div><div><br></div><div>Same thing as before: 1) no flags changes flushed to IDLE 2) until the other connection (which changed flags) does a SELECT.<br></div><div><br></div><div>The only difference from before -  it was enough for netcat to do plain SELECT (i.e. SELECT CONDSTORE was not necessary).<br></div><div><br></div><div>I also tried a netcat connection instead of "my IDLE client" and did plain SELECT before going IDLE (i.e. SELECT without CONDSTORE). Same thing: 1) delay 2) flags changes are flushed after the other connection does SELECT.<br></div><div><br></div><div>2 - I switched to Maildir last night - and the problem stopped for same old existing user.<br></div><div><br></div><div>So it looks triggered by a combination of mbox + SELECT (CONDSTORE)?<br></div><div><br></div><div>3 - No errors in doveadm log errors<br></div><div><br></div><div>4 - /var/log/mail.err has this<br></div><div><br></div><div>Mar 13 09:21:17 kman dovecot: auth: Error: Master requested auth for nonexistent client 29548 (created 0 msecs ago, handshake 0 msecs ago)<br></div><div>Mar 13 09:21:18 kman dovecot: imap-login: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory<br></div><div><br></div><div>Probably means nothing - I tried to log in with IMAP before remembering to add my new user to /etc/dovecot/users<br></div><div><br></div><div>-- K<br></div><div><br></div></blockquote><div><br></div><div>One more test with this new "test" user.<br></div><div><br></div><div>I'd stopped postfix and dovecot, deleted this user's mail in /var/mail/%u and ~%u/mail and started over. Still mbox format.<br></div><div><br></div><div>This time I used netcat for the IDLE connection, plain SELECT without CONDSTORE.<br></div><div><br></div><div>Flags changes were sent quickly.<br></div><div><br></div><div>Then on the IDLE connection I sent DONE and SELECT Inbox (CONDSTORE) - without logging out or closing the connection.<br></div><div><br></div><div>The issue started again.<br></div><div><br></div><div>I also learned that it's enough for the "other" (non-idle, flag changing) connection to do just "tag SELECT" - i.e. without mailbox name - which results in<br></div><div><br></div><div>* OK [CLOSED] Previous mailbox closed.<br></div><div>tag BAD Error in IMAP command SELECT: Invalid arguments (0.001 + 0.000 secs).<br></div><div><br></div><div>but also does send the buffered up FLAGS changes on the IDLE connection.<br></div><div><br></div><div>Hope these are useful data points.</div><div><br></div><div>-- K<br></div><div><br></div></body></html>