Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use Mail.app without performing pending operations Apps
Recently I have been on a slow internet connection, and have had trouble checking my mail with Mail.app. The previous day, I had sent an email with large attachments, and every time Mail checked for new messages, it wanted to upload that email to my Drafts folder on my IMAP account.

Deleting the draft didn't help, nor did changing settings to not store drafts on the server. Eventually I figured out there is a hidden folder containing these pending operations. To cancel any pending operations for an IMAP account, delete all the files in the following folder: ~/Library » Mail » IMAP-youremail@somedomain.com » .OfflineCache

Why Mail wants to upload a draft of an email I had already sent is another issue, and I believe it has to do with my slow internet connection: As I'm writing the email, it periodically tries to save a draft, but it fails. When it fails, it remembers to try again, but doesn't figure out that it's no longer necessary.
    •    
  • Currently 4.29 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[13,802 views]  

Use Mail.app without performing pending operations | 14 comments | Create New Account
Click here to return to the 'Use Mail.app without performing pending operations' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 28, '09 02:11:14AM

help!
I'm experiencing the same problem and it's blocking my email completely since the "pending operation" is copying some 3000+ messages...

but I can't find any offline cache, I've looked everywhere! Please advise... thanks!!



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 28, '09 09:13:37AM
Note the dot at the beginning of ".OfflineCache": that means it's a file hidden by the system. You can use terminal to delete the file via command line, or you can use a hint like this one to toggle on the Show Hidden Files feature in the FInder.

Rob, if you see this you might want to add a comment to this effect to the hint.

[ Reply to This | # ]

Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 29, '09 12:12:00AM

Thanks tedw! how do I go about it? I've looked at your link but I don't understand even the basics... how do I I quit finde?? Where do I put this script and/or how do I implement it?

Or: what should I write into the Terminal window? Where can I find the commands that show me the hidden files? I know it's a lot of questions... I reaslly appreciate your help!



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 07:30:05AM

open the Script Editor application (/Applications/AppleScript/Script Editor.app), copy the script from the link (everything in red) into the editor, and save it. You can run it straight from the script editor, run it from the script menu or quicksilver or some such, or save it as an application and ad double-click it.

it will do everything for you. play with it a bit and you'll see how it works.



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 29, '09 07:51:55AM

thnaks tedw, I've just tried what you wrote (opened the script editor, copy+paste the red text - your script, than I saved it and hit the "run"-button. All I get is: "AppleScript Error: Specified button does not exist" ... sorry, I feel really stupid - what is it that I'm doing wrong?



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 07:57:54AM

yeah, apparently that's an error in that guy's script (he wrote 'default button 3' when there are only two buttons). but try the script I just wrote, which deletes the file directly without turning hidden files on or off.

Edited on Nov 29, '09 07:58:35AM by tedw



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 07:52:00AM
actually, this script will be easier. it just deletes all the offline caches from all your IMAP folders, with no need to fuss about it.
display dialog "Delete Mail's offline caches?" buttons {"Cancel", "Delete"} default button 2
copy the result as list to {buttonpressed}

if the buttonpressed is "Delete" then
	tell application "Finder"
		set theIMAPFolders to (every folder of folder thePath whose name begins with "IMAP") as alias list
	end tell
	repeat with thisFolder in theIMAPFolders
		set theCachePath to (POSIX path of thisFolder & ".OfflineCache")
		do shell script "rm -rf " & theCachePath
	end repeat
end if
copy it into Script Editor and save/run it as you like

[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 29, '09 07:59:54AM

just did it... started so promising, asking me "delete mail's offline cache?" when i hit "ok" it says: "The Variable thePath is not defined" :(

I guess I have to change something? Put in the path to my IMAP-files? Please advise... thanks!!!!



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 08:17:28AM
whoops, sorry, forgot a line. should read as follows:
display dialog "Delete Mail's offline caches?" buttons {"Cancel", "Delete"} default button 2
copy the result as list to {buttonpressed}

if the buttonpressed is "Delete" then
	set thePath to (path to library folder from user domain as text) & "Mail"
	tell application "Finder"
		set theIMAPFolders to (every folder of folder thePath whose name begins with "IMAP") as alias list
	end tell
	repeat with thisFolder in theIMAPFolders
		set theCachePath to (POSIX path of thisFolder & ".OfflineCache")
		do shell script "rm -rf " & theCachePath
	end repeat
end if


[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: Wild_Eep on Aug 09, '10 02:09:58PM

I found that I had to add 'with administrator privileges' to the end of the 'do shell script' line in order for the script to run without throwing a permissions error. The script asks for an administrator's user/pass, but then runs properly.

[code]
display dialog "Delete Mail's offline caches?" buttons {"Cancel", "Delete"} default button 2
copy the result as list to {buttonpressed}

if the buttonpressed is "Delete" then
set thePath to (path to library folder from user domain as text) & "Mail"
tell application "Finder"
set theIMAPFolders to (every folder of folder thePath whose name begins with "IMAP") as alias list
end tell
repeat with thisFolder in theIMAPFolders
set theCachePath to (POSIX path of thisFolder & ".OfflineCache")
do shell script "rm -rf " & theCachePath with administrator privileges
end repeat
end if
[/code]



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 29, '09 08:24:57AM

yes!!!! thank you so much!!!!!! :))))

(is there any way you could tell me how to import mailboxes from my back-up? Along the way my 3000+ sent messages disappeared... and when I try to import a mailbox where I back them up, it tells me: "No valid Mail for Mac OS X files were found" - sorry to ask this in the same thread, I'm just trying to deal with the mess that my POP-to-IMAP-migration caused. but if you can't: thanks anyway, this already helped me so much!!!!!!)



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: webdevtool on May 04, '10 02:02:07PM

EXCELLENT! Thank you, all. This was the solution to two days' failed googling.

Issue (stuffed with keywords for the next guy's googling):
I inadvertently tried to send a 46 MB attachment (a large attachement that was over the server's size limits) using Mail.app on Mac OS X Snow Leopard, via Gmail.

When Gmail bounced my email for violating the attachment size limit, for whatever reason, Mail.app on my macbook just kept trying. It stayed in my cache somehow, and kept trying to send or store in my drafts or something... regardless, suddenly in Mail.app, I had new folders... like "On My Mac" under Trash, or "On My Mac" right on the root, which contained another new folder "Recovered". In Recovered there were hundreds of copies of this email, attachment and all... and still trying to send more... or copy... or whatever.

Well, sooner or later I hit google's bandwidth limits. In Mail.app I got the following error popup:
"The server returned the error: Account exceeded bandwidth limits. (Failure)"

I noticed that my iPhone mail client failed as well, with bad username or password error.

I found references to deleting the hidden super-duper-secret mail cache:
~/Library/Mail/IMAP-<username>@domain.tld@imap.domain.tld/.OfflineCache

but Apple is so gracious to protect the users from their computers, I was never able to figure out how to pull this off. Terminal is so DOS I could barf. (As a mainly Windows guy, I find owning my first mac to be hardly the Come On Over long-term conversion the ads sell; macs just work - but I digress.)

Thankfully, if I'm going to *NEED* a script to delete a file on my computer, well, at least it was here. Note: on my macbook, the applescript editor is in /Applications/Utilities/...blah blah.. you left off the Utilities folder.

Now I've unclogged my bandwidth (google kicks you for 24 hours) and deleted all this junk from mail.app and it's all working again. Thanks for the script! It will live in my Documents folder forever.



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: ebneuhaus on Jun 06, '10 03:53:20AM
This solution solved a problem that hijacked my system to the point of SEVERE system degradation and general network degradation. Here's what happened: I ended up with recursive gmail pending operations as a result of trying to use an email callout from within a pdf file. When my system started misbehaving, I blamed the storm and shutdown my mac. Over the next few days, I had problems with network connectivity-and mac responsiveness- and assumed that the DSL modem had flaked out. While trouble shooting, I noticed that my network problem was related to whether my mac was running or not. I immediately thought of malware since I had recently downloaded and installed new software (although I scanned it first with avast). Fortunately, I noticed that the gmail progress shield was continuously spinning and so investigated the activity report window from within Mail. Stopping the related tasks within the activity window did not fix the problem, nor did deleting sent files or "recovered" gmail files. But amazingly, after deleting the files named "1 2 3 4" from within the .OffLineCache folder (using terminal), the recursive operations subsided after about 3 additional minutes of syncing with gmail. Thanks a million for posting this solution!!!

[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: piper on Nov 03, '10 04:05:29PM

Thank you! This saved me tonight!

J



[ Reply to This | # ]