Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail cannot clear Drafts in .OfflineCache but can save to Drafts on server

OK, I've been chasing this problem (and other related issues) for three days now and I'm at wits end.

I see that I am not alone with the the Mac Mail app getting stuck with messages in its .OfflineCache folder for an email account that it can not process. The common response is to quite Mail, and delete the contents of .OfflineCache, if not the whole directory.

In the case in front of me now, I have 7 versions of a draft message (destined for "Drafts"), a delete of that draft message and a copy of that message destined for "Sent Messages". Obviously, for a while Mail could not execute these commands to the IMAP server at SpamArrest.

What I don't understand is why can I continue to save new files to Drafts and Sent Messages but the .OfflineCache cannot clear itself?

I don't want to just delete the files in .OfflineCache (partly because I need the one in Sent Messages) but I because that is just treating the symptom and not fixing the recurring problem of messages ending up .OfflineCache on a fairly regular basis.

Why can't Mail clear the .OfflineCache?

iMac G5, MacBook Pro, 30GB iPod, 8GB iPhone, Mac OS X (10.5.7), .Mac

Posted on May 22, 2009 12:02 PM

Reply
8 replies

May 23, 2009 3:03 PM in response to chip.r

I'm wondering if this could possibly be a permissions problem on my Mac but I'm not sure. I know I'm not alone in this but I'm wondering what the permissions should be on the folder and it's contents?

This is what my looks like currently, though I just had Disk Utility repair permissions:

Chips-MacBook-Pro:.OfflineCache chip$ ls -alf
total 40
drwx------ 7 chip staff 238 May 23 07:47 .
drwx------ 7 chip staff 238 May 23 07:47 ..
-rw-r--r-- 1 chip staff 1415 May 23 07:23 1
-rw-r--r-- 1 chip staff 1411 May 23 07:43 2
-rw-r--r-- 1 chip staff 1543 May 23 07:45 3
-rw-r--r-- 1 chip staff 1716 May 23 07:46 4
-rw-r--r-- 1 chip staff 256 May 23 07:47 operations

As far as I can tell, those permissions seem reasonable.

What I did note is that my Gmail account's folder has its permissions set to:

drwxrwxrwx+ 13 chip staff 442 May 23 07:47 .
drwx------ 2 chip staff 68 May 19 20:18 .OfflineCache

but my Mac account's folder is set to:

drwx------ 12 chip staff 408 May 23 07:47 .
drwx------ 2 chip staff 68 May 4 08:16 .OfflineCache

and both of those are OK. So, the fact that my SpamArrest accounts' folders are:

drwx------ 7 chip staff 238 May 23 07:47 .
drwx------ 2 chip staff 68 May 23 14:50 .OfflineCache

should not be problematic. Is there any place else permissions could be causing a problem?

Chip

May 24, 2009 11:27 PM in response to chip.r

I keep looking at the IMAP protocol output from the Connection Doctor and I'm stymied at why I'm getting a time out. In tracing the log, I see us connect on port 993 with thread 0x187564f0:

CONNECTED May 24 23:00:28.046 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x187564f0


We then start a new thread 0x191581a0 which performs all the subsequent actions including the APPEND:

WROTE May 24 23:00:29.286 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
4.35 APPEND INBOX.Drafts (\Seen \Draft $NotJunk NotJunk) "24-May-2009 17:21:45 -0700" {5050}

READ May 24 23:00:29.356 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
+ OK

WROTE May 24 23:00:29.367 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
X-Uniform-Type-Identifier: com.apple.mail-draft
From: Chip Roberson < chip@clickmarkets.net >
...


The next thing I see is a timeout on thread, 0x191581a0:

READ May 24 23:01:29.355 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
* BYE Disconnected for inactivity


It would seem that my client is in a wait state, waiting for a response from the WRITE which it does not get a response. Given that I have written to this Drafts folder before, I know it can be done but right now I can't.

SpamArrest swears they don't see anything on their side and that the problem must be on my Mac but what could it be?

The only other clue is that immediately after the Disconnect message, I get the hashtable error:

READ May 24 23:01:29.437 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x187564f0
BYE [ALERT] Fatal error: INTERNAL ERROR: Keyword hashtable memory corruption: Input/Output error


That seems to be a direct result of the timeout but it's hard to know for sure. I wish I knew what "keyword hashtable".

I've done all the standard stuff (e.g. rebuilding, reindexing, permissions, etc.) so I'm struggling to find something else to do. I just wish I could get some more visibility into the problem. Given the symptoms I'm seeing in other threads in this forum, I don't think I'm on the only one with this problem. Am I?

May 24, 2009 11:55 PM in response to chip.r

Well, I decided to Google (I almost said "grep") for "IMAP append write hangs" and found that this has been a long-standing issue with Mozilla/Thunderbird:

http://forums.mozillazine.org/viewtopic.php?t=218625

The most interesting comment is in this blog as it appears the Apple IMAP client may be ignoring the information from the COMPATIBILITY response and using the "NotJunk" argument even if it's not supported.

http://throwable.wordpress.com/2007/12/23/the-imap-command-append-failed/

Specifically, the segment of the log in question is:

READ May 24 23:00:29.200 \[kCFStreamSocketSecurityLevelNegotiatedSSL\] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
* CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=CRAM-MD5 ACL ACL2=UNION
2.35 OK CAPABILITY completed

WROTE May 24 23:00:29.212 \[kCFStreamSocketSecurityLevelNegotiatedSSL\] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
3.35 LIST "" ""

READ May 24 23:00:29.272 \[kCFStreamSocketSecurityLevelNegotiatedSSL\] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
* LIST (\Noselect) "." ""
3.35 OK LIST completed

WROTE May 24 23:00:29.286 \[kCFStreamSocketSecurityLevelNegotiatedSSL\] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
4.35 APPEND INBOX.Drafts (\Seen \Draft $NotJunk NotJunk) "24-May-2009 17:21:45 -0700" {5050}

READ May 24 23:00:29.356 \[kCFStreamSocketSecurityLevelNegotiatedSSL\] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
+ OK


The fact that we see "$NotJunk NotJunk" looks suspicious to me. Is a parameter to a write() command that should be interpreted being written to the socket as a literal string? That's just a guess, of course and it doesn't explain why sometimes the command succeeds.

Can anybody verify any of this?

Jun 2, 2009 10:37 AM in response to chip.r

Sorry to say that I am having the exact same problem - also using IMAP and spamarrest. Messages are being sent but mail is leaving a copy of each message in the drafts folder.

Just switched to IMAP about a week ago from POP and everything had been working up to yesterday.

From what I have been able to find this looks like a common problem with IMAP based accounts and something without a good solution.

Jun 4, 2009 7:15 AM in response to Roger.Z

Yes, the best I can tell this problem only arises (or goes away) if the right combination of server software is used with the Mac Mail.app client.

I'm going to have to give up on SpamArrest and find another IMAP server. RIght now I'm considering NetworkSolutions since that is where our domain is registered.

It would be nice to start a list of IMAP servers that do not have this problem. So far, it seems that MobileMe and GMAIL are OK.

Suggestions?

Mail cannot clear Drafts in .OfflineCache but can save to Drafts on server

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