Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-21 Thread Mark Crispin

On Mon, 21 Dec 2009, Ken Murchison wrote:
I've added an option that can be enabled that 
forces \Seen state to be flushed immediately and exhibits proper IMAP 
behavior.


The new dev branch of Cyrus will have a reworked \Seen state where it should 
work correctly by default.


Cool!  Thanks!

By the way (given another conversation we had) the new POP server that I'm 
doing doesn't use any IMAP flags at all.  I may change it to use the IMAP 
flags the way that UW/Panda ipop3d does, but for the nonce it turned out 
to be more convenient not to do that.  This also means that I'm not 
bothering with the LAST command.


-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Mark Crispin

On Thu, 17 Dec 2009, Timo Sirainen wrote:

A server that requires use of the NOOP command to synchronize is broken.

Sure, but there are such servers. For example Cyrus. Actually in Cyrus
it seems to work in a rather weird way:

session 1: 1 store * +flags \seen
(session 2 won't see this change, no matter what it does.)

session 1: 2 noop
(session 2 still won't see the change with fetch flags.)

session 2: 3 noop
(now session 2 finally gets the untagged FETCH FLAGS reply.)


In that case, Cyrus is broken.  I'll point that out to Ken Murchison the 
next time I talk with him.


-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Timo Sirainen
On Thu, 2009-12-17 at 11:29 -0800, Mark Crispin wrote:
> On Thu, 17 Dec 2009, Timo Sirainen wrote:
> > On Thu, 2009-12-17 at 10:22 -0800, Mark Crispin wrote:
> >> No server "caches the flags" as you describe.  If the mail store in the
> >> server supports multiple simultaneous sessions to the same mailbox (e.g.,
> >> mix and mbx formats in UW), then flags are updated immediately.
> > Well, not necessarily immediately, at least not all servers. A NOOP
> > command should refresh flags and other things with most servers.
> 
> A server that requires use of the NOOP command to synchronize is broken.

Sure, but there are such servers. For example Cyrus. Actually in Cyrus
it seems to work in a rather weird way:

session 1: 1 store * +flags \seen
(session 2 won't see this change, no matter what it does.)

session 1: 2 noop
(session 2 still won't see the change with fetch flags.)

session 2: 3 noop
(now session 2 finally gets the untagged FETCH FLAGS reply.)

> A client that uses the IDLE command has no reason to use the NOOP command, 
> ever.

Yes, IDLE and NOOP are the commonly working ways. With the above Cyrus
example session 2 could have been IDLEing instead of doing a NOOP.

> > Hmm. Dovecot's current behavior is that doing a FETCH FLAGS just after
> > its flags had changed in another session first returns one FETCH FLAGS
> > with the old flags (the FETCH reply), then another FETCH FLAGS with the
> > updated flags (after it noticed the changes).
> 
> That's OK.  It's in the same set of responses, isn't it?  The later flags 
> response overrides the former one.

Right. I changed it anyway, maybe it'll help some poorly implemented
client.


signature.asc
Description: This is a digitally signed message part
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Mark Crispin

On Thu, 17 Dec 2009, Timo Sirainen wrote:

On Thu, 2009-12-17 at 10:22 -0800, Mark Crispin wrote:

No server "caches the flags" as you describe.  If the mail store in the
server supports multiple simultaneous sessions to the same mailbox (e.g.,
mix and mbx formats in UW), then flags are updated immediately.

Well, not necessarily immediately, at least not all servers. A NOOP
command should refresh flags and other things with most servers.


A server that requires use of the NOOP command to synchronize is broken.

A NOOP command MUST NOT do anything special.  It's a no-op.  Its only 
purpose is to cycle the server engine if otherwise has nothing to do. 
Any server refresh operations MUST be done on every command.


A client that uses the IDLE command has no reason to use the NOOP command, 
ever.



Hmm. Dovecot's current behavior is that doing a FETCH FLAGS just after
its flags had changed in another session first returns one FETCH FLAGS
with the old flags (the FETCH reply), then another FETCH FLAGS with the
updated flags (after it noticed the changes).


That's OK.  It's in the same set of responses, isn't it?  The later flags 
response overrides the former one.


-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Timo Sirainen
On Thu, 2009-12-17 at 10:22 -0800, Mark Crispin wrote:
> No server "caches the flags" as you describe.  If the mail store in the 
> server supports multiple simultaneous sessions to the same mailbox (e.g., 
> mix and mbx formats in UW), then flags are updated immediately.

Well, not necessarily immediately, at least not all servers. A NOOP
command should refresh flags and other things with most servers. 

Hmm. Dovecot's current behavior is that doing a FETCH FLAGS just after
its flags had changed in another session first returns one FETCH FLAGS
with the old flags (the FETCH reply), then another FETCH FLAGS with the
updated flags (after it noticed the changes). It would be simple to
change it to return the updated flags immediately. I suppose I should do
that..



signature.asc
Description: This is a digitally signed message part
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Mark Crispin

On Thu, 17 Dec 2009, Shawn Walker wrote:

Never mind, I see that I can do a ".select foldername" to refresh the cache.


This increasingly sounds like you are accessing a UW server with 
traditional UNIX mailbox format.


If you do a new SELECT, then you steal the mailbox from the other session 
and the other session can no longer do anything with the mailbox.


So you haven't fixed the problem.  You just moved the symptom to someplace 
else.


No client should EVER, under ANY circumstances, open the same mailbox more 
than once.  Such a client is fundamentally broken, and will NEVER work 
well.


-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Mark Crispin

On Thu, 17 Dec 2009, Shawn Walker wrote:
How does the client tell the server to refresh the message flags?  The client 
is multithreaded and that we have multiple connections to the server (2).


That is not a good client design.  There is neither guarantee nor 
requirement in IMAP that the server supports multiple simultaneous 
read-write access to a mailbox.


If the server is UW with traditional UNIX format (mbox) format, there is 
no simultaneous read-write access, and every time you open the mailbox 
read-write it forcibly closes the mailbox in the previous session.


The mix and mbx formats support simultaneous read-write access, but they 
do immediate flag updates across sessions.


We 
have a situation where the client mark a message as read in one thread, but 
when the synchronize the folder, the client send ". UID FETCH 15402 FLAGS", 
the server send back "* 5261 FETCH (FLAGS (\Answered) UID 15402)" which mean 
that the message is unseen for that connection.


If the server is UW with traditional UNIX format, this happened because 
the mailbox was forcibly closed.  See above.


Obviously the IMAP server is caching the flags for the connection, but I need 
it to dump the cache or refresh the message cache, but without logging out 
and log back in every time the client want to get the message flags.


No server "caches the flags" as you describe.  If the mail store in the 
server supports multiple simultaneous sessions to the same mailbox (e.g., 
mix and mbx formats in UW), then flags are updated immediately.


-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


Re: [Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Shawn Walker

Never mind, I see that I can do a ".select foldername" to refresh the cache.

Regards,
Shawn

On 12/17/2009 11:37 AM, Shawn Walker wrote:

How does the client tell the server to refresh the message flags?  The
client is multithreaded and that we have multiple connections to the
server (2). We have a situation where the client mark a message as read
in one thread, but when the synchronize the folder, the client send ".
UID FETCH 15402 FLAGS", the server send back "* 5261 FETCH (FLAGS
(\Answered) UID 15402)" which mean that the message is unseen for that
connection.

Obviously the IMAP server is caching the flags for the connection, but I
need it to dump the cache or refresh the message cache, but without
logging out and log back in every time the client want to get the
message flags.

Regards,
Shawn
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw

___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw


[Imap-uw] Force IMAP server to refresh message flags?

2009-12-17 Thread Shawn Walker
How does the client tell the server to refresh the message flags?  The client is multithreaded and 
that we have multiple connections to the server (2).  We have a situation where the client mark a 
message as read in one thread, but when the synchronize the folder, the client send ". UID FETCH 
15402 FLAGS", the server send back "* 5261 FETCH (FLAGS (\Answered) UID 15402)" which mean that the 
message is unseen for that connection.


Obviously the IMAP server is caching the flags for the connection, but I need it to dump the cache 
or refresh the message cache, but without logging out and log back in every time the client want to 
get the message flags.


Regards,
Shawn
___
Imap-uw mailing list
Imap-uw@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw