Problems with read/unread mail on IMAP server

[ Edited by Apple Discussions Moderator; Please start a new topic about your technical issue. ]

I'm having the strangest problem and I've yet to find a pattern or explanation for it. I retrieve all my mail from an IMAP server and store cached copies on my Mac. Sometimes after I've read a message, and Mail.app marks it as such, it will re-flag itself as unread after a number of minutes. Sometimes it's immediately, other times it's after several hours. It doesn't happen on all messages, just some, and seems to happen in at random in any of my IMAP folders. It's incredibly annoying. Has anyone else had this happen or do you know how to fix it? It doesn't seem to happen with other MUAs, just Mail.app. Thank you!

PowerMac Dual G5 2GHz, Mac OS X (10.4.4), Mail.app 2.0.5

Posted on Jan 25, 2006 1:54 PM

Reply
31 replies

Jan 26, 2006 2:06 PM in response to Daniel Prather

Daniel,

Welcome to the Discussions.

While I only have IMAP accounts for test purposes, and they are not heavily used, I am aware, and am investigating some problems of display and caching. I am also aware that not every IMAP server exhibits the same behavior, with display and caching, and I am also aware that Mail 2.0 in Tiger can have these problems, but not Mail 1.3.11 in Panther.

However, I have not seen or heard reported this problem with Read vs Unread. Please provide us some additional information, which may be useful to others.

But also, please tell us if your mailboxes and account folders would have originated in Panther, and were converted as Tiger was installed. If this is the case, there are some specific questions to ask, and observations needed.

Ernie

Jan 26, 2006 5:32 PM in response to Ernie Stamper

The mailboxen and folders were created on this machine with a fresh Tiger install. So that shouldn't be the problem.

I've tested with Mozilla Thunderbird as well as well as Squirrelmail (I have webmail on this server as well) and neither of them seem to have the problem, though they DO show the messages marked as unread when I load them up, even if I've already read that message in Mail.app. It doesn't happen for all messages, though, so I've not been able to figure out what the problem is. 😟

I don't know if it has something to do with Mail.app caching the mail (as I've told it to do) and is marking it as read there, but doesn't mark the message as read on the server. So perhaps when the mailboxen are scanned again for new messages, it resets the read flag on the cached copies and the problem occurs again.

The IMAP server in question is courier-imap 4.0.4. I've already checked on their mailing list, but nobody there has encountered such a problem. Is there perhaps a way in Mail.app to look at all the requests/responses it makes/receives? That might be useful too.

Jan 27, 2006 8:06 AM in response to Daniel Prather

I have the same problem. It has persisted through an entire OS reinstall, changes to the IMAP servers, etc. It first started happening when I installed Tiger; up to that point, it had never occurred. It has happened to me now for almost a year (I got Tiger soon after its release).

Details:
I have two IMAP servers that I connect to; one for work, and one at home. They are different programs as well (the work one is Cyrus Imap on Redhat, the home one is Courier on Debian Stable). The unread problem happens on both of them. When I first download the messages, they show as read, but then later (sometimes immediately after closing the Mail.app window, and sometimes a few minutes / up to about an hour later, some messages show up as unread again. (BTW, I am using Bronson Beta's Mail.appetizer for new mail notifications, and when the old messages get marked as new, it does not show a new notification; I would imagine that it indicates that Mail.app does not think that there is new mail; rather, that is just gets the read attributes mixed up).

Any information would be very helpful.

Thanks
Wyatt

12 G4 Powerbook 1Ghz Mac OS X (10.4.4)

Jan 27, 2006 10:04 AM in response to Wyatt Olson

Wyatt,

Welcome to the Discussions.

Mail Appetizer, was initially incompatible with Tiger, but I think has been updated -- have you updated it? See:

http://www.macupdate.com/info.php/id/13900

and

http://www.versiontracker.com/dyn/moreinfo/macosx/22225&page=2

Notice the comments.

If I were you, I would uninstall, or otherwise remove the Mail Appetizer, and then remove the two IMAP accounts in Mail Preference. If your access to them is straight forward, the everything should stay of the server, and no account mailboxes would be lost. Then re-enter the IMAP accounts, and let Mail set them up again, and connect to the server to see what will result. Then, if determined, install the latest version of Mail Appetizer and test further.

Later,

Ernie

Feb 6, 2006 12:09 AM in response to Daniel Prather

Gentlemen,

I have had the same problem for most of my time with Tiger. It has survived a complete format and reinstall a couple of weeks ago.
It happens on the .mac account and all IMAP accounts I have. There is no pattern visible but about 20% of all my emails revert to unread after a few minutes. It happens in all IMAP and .mac folders but only for the last 5-6 messages. Older messages never change back to unread.

It is anoying enough to make me consider using another email client.

Any help would be appreciated.

G5 2x2.5GHz Mac OS X (10.4.4) Mail 2.0.5

Feb 16, 2006 8:10 AM in response to Daniel Prather

I brought this up with Apple and Mirapoint (the providers of our mail server infrastructure) a year and a half ago when I was running 10.3.4. The discussions ended up to a difference of opinion between the two companies concerning the IMAP spec. This has always been a issue with Mail.app ever since I can remember from back in the 10.0 days up until at least 10.4.4.

I will post the tail end of the discussion with the names removed to protect the innocent. I will admit that alot of this stuff is over my head. I also don't know how this applies to other mail servers. I don't think any other IMAP clients that I know of exhibit this read/unread state issue.

FROM APPLE:
Thanks for your patience on this escalation. A Mail.app engineer has reviewed the logs you sent in and determined that the Mirapoint server is returning the wrong response.

Specifically, in return to SELECT their server is returning:

* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NotJunk Junk Forwarded JunkRecorded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen NotJunk Junk Forwarded JunkRecorded \*)]
* 11 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1057775569]
3 OK [READ-WRITE] Completed

They are using the PERMANENTFLAGS response for session-based IMAP flags, which unfortunately does not abide by the IMAP spec. The engineer has agreed that Mail.app could likely do a better job handling session-based flags but concurrently Mirapoint needs to rev their software to return the appropriate response as per the IMAP spec.

MIRAPOINT'S RESPONSE:
I went through the spec (RFC 2060) and found the following...

IMAP server can allow a client to create permanent flags that can be stored:
Under Section 2.3.2. Flags Message Attribute

A keyword is defined by the server implementation. Keywords do not begin with "\". Servers MAY permit the client to define new keywords in the mailbox (see the description of the PERMANENTFLAGS response code for more information).

Also,

Under Section 6.3.1. SELECT Command
If the client can not change the permanent state of one or more of the flags listed in the FLAGS untagged response, the server SHOULD send a PERMANENTFLAGS response code in an OK untagged response, listing the flags that the client can change permanently.

Also,

Under Section 7.1 Server Responses - Status Responses....

PERMANENTFLAGS Followed by a parenthesized list of flags, indicates which of the known flags that the client can change permanently. Any flags that are in the FLAGS untagged response, but not the PERMANENTFLAGS list, can not be set permanently. If the client attempts to STORE a flag that is not in the PERMANENTFLAGS list, the server will either reject it with a NO reply or store the state for the remainder of the current session only. The PERMANENTFLAGS list can also include the special flag \*, which indicates that it is possible to create new keywords by attempting to store those flags in the mailbox.

Now, referring to the earlier IMAP session (over telnet ) that I had you do:

. select inbox
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NotJunk Junk JunkRecorded Forwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen NotJunk Junk JunkRecorded Forwarded \*)]
* 12 EXISTS
* 2 RECENT
* OK [UNSEEN 11]
* OK [UIDVALIDITY 1056569562]
. OK [READ-WRITE] Completed
. fetch 1:* flags
* 1 FETCH (FLAGS (\Seen))
* 2 FETCH (FLAGS (\Seen NotJunk))
* 3 FETCH (FLAGS (\Answered \Seen NotJunk))
* 4 FETCH (FLAGS (\Answered \Seen Forwarded))
* 5 FETCH (FLAGS (\Seen))
* 6 FETCH (FLAGS (\Seen))
* 7 FETCH (FLAGS (\Seen))
* 8 FETCH (FLAGS (\Seen))
* 9 FETCH (FLAGS (\Seen))
* 10 FETCH (FLAGS (\Seen))
* 11 FETCH (FLAGS (\Recent))
* 12 FETCH (FLAGS (\Recent))
. OK Completed

As you can see above, "NotJunk", "Forwarded" are the PERMANENTFLAGS defined and stored by Mail.App client, not the session specific flags. According to the snippets that quoted above from the IMAP specs, I think Mirapoint is correct in its PERMANENTFLAGS response.

Feb 21, 2006 11:11 AM in response to Ernie Stamper

I can only
note that this particular issue with IMAP is not
widely reported, and I have not experienced it with
limited test activity on two different IMAP servers.


I can report this issue, too. The strange behaviour of the unread/read-status of some messages (and the incorrect count of unread messages in IMAP-folder) occurs on three different IMAP accounts, one of them is .mac. I don't think Apple-.mac- and -Mail.app-engineers have different opinions about the way IMAP works, so in my opinion there's a very annoying big bug in Mail.app.

Regards
Ralf

Mar 1, 2006 1:25 PM in response to Daniel Prather

i can confirm having this problem too. it occurs very frequently after receiving my MBP. i recall it happened infrequently using my older 10.4 powerbook.

the IMAP server is using UW's imap software v 2004a though i will be upgrading it to 2004g soon.

usually it only affects one or two recent messages in my inbox. when new zombie messages arrive the older ones tend to go away.

MBP Mac OS X (10.4.5)

Mar 5, 2006 5:40 AM in response to Ernie Stamper

Hi everybody!

judge the correctness of either response. I can only
note that this particular issue with IMAP is not
widely reported, and I have not experienced it with


I can report this bug too. The server is using Courier-IMAP 4.0.6/i386-portbld-freebsd6.0. And a friend of mine on the same server is having the very same problem.

This bug is persisting for a while now and while I was hoping some software update would fix it, nothing happened to my disappointment. I think its more widely spread than you would think, but its one of these bugs that you don't notice at first, but that are really getting on your nerves with time passing.
I'm already thinking about switching to Thunderbird, though I really like Mail.app...

iBook G4 1.2 Mac OS X (10.4.5)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problems with read/unread mail on IMAP server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.