Benches macOS

13

Mail.app IMAP incorrect msg counts (not u…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Greetings all. Wondering if anyone else has seen this. I'm using Mail.app Version 3.6 (935/935.3) on 10.5.7, fully up to date. My primary mail account is an IMAP account on a private server, running CourierIMAP. Recently (since the 10.5.7 update) my 'Message Count' on my inbox (displayed in the Inbox window title bar) has started changing to incorrect and ludicrously large numbers (like, for example 4292967808). I have tried Rebuilding the mailbox using the menu item, and that fixes the display - until I click on another folder and then click back, when the number is back to the same ridiculously wrong one. Note that this is
not an 'unread messages' count; that's working properly.

Just to make sure, I moved all my mail from my inbox (we're talking around 250-300 messages, I tend to file) into a subfolder. For a while, I had zero messages in my inbox. At the moment, I have 1 message there. The ludicrous numbers remain, as does the 'fixed for a second' rebuild behavior. This has survived multiple restarts of Mail and of OS X, and in fact the behavior occurs on different copies of Mail on different machines, although I think the ludicrous numbers displayed are different.

That last bit of info leads me to suspect I'll be told that Courier is doing something wrong. However, it worked fine until recently, and everything else seems to be working - I can get and see all my mail, and it seems to be flagging/unflagging properly.

Anyone seen this? Thanks.

13 replies

Sign in or join Beachball Help to reply.

  1. 0

    Waleed Alzuhair

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Mail stores the index information of the emails displayed in a file named "Envelope Index" (I think it's an SQLite file). It is located under your "~/Library/Mail" directory..

    From Mail.app, if you choose the option "Mailbox>Rebuild" it will rebuild the above index file and hopefully correct your problem.

    You will not see any progress thermometer for the rebuild, so give it a few minutes to see the result.

    Best of luck,

    Waleed

    Message was edited by: Waleed Alzuhair

  2. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Waleed-

    Many thanks for your reply. I tried the following:

    1) I tried selecting 'rebuild mailbox' and letting Mail sit for ~10 minutes. No indications of activity occurred, and the problem didn't go away.

    2) Quit mail, went to the location you specified, and renamed the 'Envelope Index' file to 'Envelope Index.bak.' Then relaunched Mail. Mail came up and said it needed to 'Import my messages' before I could use Mail, and that it would take a few minutes. I told it OK; it gave me a progress window and (apparently) indexed the messages in my account and brought back up the main Mail window. All my folders and messages look OK, but the message count is still some ludicrous number (albeit a slightly different one). I checked the directory; the 33-MB index file I renamed is still there, and a new 5-MB index is as well with a newer mod date. So it looks like it did reindex, but didn't fix the problem.

    Also, selecting 'Rebuild' from the menu doesn't produce
    any feedback that it's doing anything, and nor does it change the mtime or size of the Index file. :-/

    So it appears I'm still out of luck.

  3. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hm, one thing to note - if I select a subfolder, 'Rebuild' kicks off a progress spinner next to the folder name. But that's folders listed under the Account header in the left bar. Selecting anything under 'Mailboxes' produces no result when I hit 'Rebuild.'

  4. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Okay, this is
    odd behavior: I just noticed that the 'ludicrously long' number in the Message count is *decrementing by one* every time I select that mailbox. At the moment, it reads (4294967294 messages). If I click another folder and then click back on 'Inbox' it decrements by one to read (4294967293 messages). If I click another folder and wait several seconds and then click back, it still only decrements by one; it doesn't appear to be time related. That works if I click a smart mailbox and then back, or click 'Trash' and then back. Same behavior.

    Even odder. If I
    quit Mail and restart it, the number resets - to 4294967295. If I run it down a couple dozen by clicking around and then quit and restart, the number is reset again back to 4294967295.

    Confused and interested.

  5. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Curiouser and curiouser. When I went to look into the Maildir that my Inbox points to, I found a message sitting in the /cur subdirectory. It was marked with the suffixes ",ST". it wasn't showing up in my Inbox in Mail, which was empty. I know that the 'T' suffix means 'trashed' - but the message wasn't showing up in my Trash either. I removed the file on the server, leaving a completely empty /cur directory - and now the message count is behaving properly. If it happens again, I'll see if I can link the behavior to a 'ghost' trashed message...

  6. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    For anyone cleverer than I (most of you) the filename of the mystery message, which corresponded to the the number listed above, was:

    1247828856.32312_0.orthanc:2,ST

    orthanc is the name of my mailserver, and I understand that 2,ST means 'individual flags: Seen, Trashed'. Maybe someone smarter than I can link the number I saw to that filename? Maybe that filename being improperly interpreted or improperly sent would account for the odd number seen in the message count?

  7. 0

    Waleed Alzuhair

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Glad you resolved it, and thanks for sharing all the information..

  8. 0

    Allen Valentine

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    J.B.

    Greetings from a novice.

    I am having the same problem regarding an incorrect count with my inbox, I can see from your post that you were able to resolve your issue... but after reading it 10 times over again I still don't understand the steps you are suggesting to resolve the issue.

    Can you do me a small favor and post a simplified version of the steps to take to get this fixed.

    Thanks in advance.

    Allen

  9. 0

    Mrjinglesusa

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I'm having the same issue, only my IMAP account is a .Mac account. My number is similar to yours: 4294966651 but does not decrease by one each time as yours does. It appears to simply pick some other random string of numbers. Weird and annoying.

  10. 0

    Big Daddy K

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    My MobileMe account acts in a similar but not identical way. Instead of a ridiculously large number, I get a zero or maybe a number close to twice or three times the actual number. It's been happening for a year or so, I believe.

    My wife just got a MacBook Pro 13" yesterday. Her MobileMe was doing the same thing (favoring the zero), and continues to have the problem after the 10.5.8 update. Her's is actually worse... It almost never displays the correct number, while I can click on another folder and back on the Inbox to fix mine normally.

  11. 0

    J.B. Zimmerman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Let me apologize to those also suffering from this problem. I have a set of steps which
    mostly fixed it, but sometimes the problem reappears. What I have done is isolate what I think is the cause of the problem.

    The problem seems to happen when you have more than one computer (or at least, more than one mail client) checking your imap mailboxes
    and their preferences on how they handle messages in the Trash are
    different. It looks like it's possible for messages that have been marked 'Trash' on those computers which 'move the messages to the Trash mailbox' to cause confusion on those computers which are set for 'delete instantly', or maybe vice versa.

    Once I went over all my computers and made sure that their preferences for handling Trash were identical, and then logged into the server manually (via command line) and deleted all messages in the maildir which had a 'T' extension (Trash) then everything was fine.

    I realize that may not help everyone. If I find a foolproof set of steps, especially a set which doesn't involve command line logins, I'll post that.

  12. 0

    Christopher Twomey

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hate to be off topic here, but JB, this isn't solving my problem. And I need a steak. I have a more or less unrelated problem, but stumbled on this thread. Small internet. Now, about that steak.

  13. 0

    pos009

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Same issue to the 'T', and it seems to be fixed by making sure that the frequency of trash removal from all email account servers accessed by the Mail client were all set the same. (I suspect it was the one IMAP account, but I have both POP and IMAP accessed).

    Thanks for posting!