[Dovecot] message status changed from new to old on read
Hi. I'm new to IMAP, but just tried uw-imapd and then dovecot in conjuction with offlineimap. I'm using Debian package version 0.99.14-1 and have my mail in mbox format.
One of the first things that annoys me about both programs is that as soon as you read a mailbox over imap, the imapd changes all "new" messages to "old". It seems to have the assumption that the IMAP client is "reading" the messages, but particularly in the case of offlineimap, this assumption is not justified: I might not read the message on the client on which I've just synced, I might read it on the server or another client. So I would like dovecot to leave the mailbox alone, and leave it up to the client to write any changes to message status. Is there any option to dovecot that would accomplish this?
While experimenting, I noticed that dovecot sometimes doesn't notice changes to the status made directly on the server. For example, if I create new mbox mailbox with one message (initially "new"), and access it with imap (using mutt in this example), it shows up "new" in the client. When I next access it with imap, it shows up "old", because dovecot modified the status as described above. If I then run mutt directly on the mailbox and change the status back to "new", then access it with imap, it still shows up "old". If I then remove the .imap directory containing the caches, it is back to "new". I assume that dovecot is supposed to pick up changes made directly on the server, right?
Thanks for your help, Andrew
There are two relevant flags associated with a message in IMAP, "SEEN" and "RECENT". "New" messages might be considered unread ones (don't have the "SEEN" flag set) or "recent" ones.
The client gets to modify "SEEN", which it typically does when it reads the message. The server is the only thing that can modify "RECENT", which it does when it has notified a client that has "SELECT"-ed (i.e. opened) the folder about new messages.
I assume "offlineimap" is behaving just like a normal client and "SELECT"-ing the folder in order to download messages. If it doesn't want to change the "RECENT" status, then it should use "EXAMINE" (opens mailbox readonly) instead of "SELECT". Likewise, it shouldn't set the "SEEN" flag unless it wants to signal that the message has been read.
In other words, Dovecot is behaving correctly as far as I can tell, and offlineimap is probably to blame. See RFC 3501 (e.g. "http://rfc.net/rfc3501.html#s2.3.2.") for details!
Best Wishes, Chris
On Tue, 19 Apr 2005 17:03:49 -0700 Andrew Pimlott andrew@pimlott.net wrote:
Hi. I'm new to IMAP, but just tried uw-imapd and then dovecot in conjuction with offlineimap. I'm using Debian package version 0.99.14-1 and have my mail in mbox format.
One of the first things that annoys me about both programs is that as soon as you read a mailbox over imap, the imapd changes all "new" messages to "old". It seems to have the assumption that the IMAP client is "reading" the messages, but particularly in the case of offlineimap, this assumption is not justified: I might not read the message on the client on which I've just synced, I might read it on the server or another client. So I would like dovecot to leave the mailbox alone, and leave it up to the client to write any changes to message status. Is there any option to dovecot that would accomplish this?
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
On Wed, Apr 20, 2005 at 10:32:12AM +0100, Chris Wakelin wrote:
There are two relevant flags associated with a message in IMAP, "SEEN" and "RECENT". "New" messages might be considered unread ones (don't have the "SEEN" flag set) or "recent" ones.
The client gets to modify "SEEN", which it typically does when it reads the message. The server is the only thing that can modify "RECENT", which it does when it has notified a client that has "SELECT"-ed (i.e. opened) the folder about new messages.
I assume "offlineimap" is behaving just like a normal client and "SELECT"-ing the folder in order to download messages. If it doesn't want to change the "RECENT" status, then it should use "EXAMINE" (opens mailbox readonly) instead of "SELECT". Likewise, it shouldn't set the "SEEN" flag unless it wants to signal that the message has been read.
Thanks for your clear explanation. I've forwarded it to the offlineimap developer.
I still think that modifying "RECENT" when the client has "SELECT"-ed the folder is a poor design choice (by the RFC, I guess, not you). Consider the case where the client SELECTs a folder then immediately crashes. When it runs again, none of the messages will be RECENT, even though they were never visible (in any way) to the user. In other words, this design is not end-to-end and makes RECENT effectively meaningless.
Andrew
participants (2)
-
Andrew Pimlott
-
Chris Wakelin