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

Stop Mail.app from caching too many IMAP folders Apps
My mail server has thousands of shared IMAP folders, and Mail.app has no notion of "subscribe/unsubscribe" folders -- it simply presents you with all folders visible from your namespace. If you click on a folder, Mail.app will attempt to synchronize and cache that folder's messages forever. There is no way to unsubscribe or selectively stop caching, but...

If you remove the folder(s) that you want to stop caching from ~/Library -> Mail -> IMAP -> your_user@your_domain.com, then Mail.app will stop caching that folder ... that is, at least until you click on it again (so don't do that!).

This was very helpful to me, as my Mail.app was attempting to synchronize folders containing a total of over 3,000,000 messages.
    •    
  • Currently 2.00 / 5
  You rated: 3 / 5 (4 votes cast)
 
[32,141 views]  

Stop Mail.app from caching too many IMAP folders | 21 comments | Create New Account
Click here to return to the 'Stop Mail.app from caching too many IMAP folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Stop Mail.app from caching too many IMAP folders
Authored by: larse on Jun 28, '05 12:32:24PM
Here is my perl IMAP proxy that lets you "unsubscribe" from folders you don't want to see. They also don't get indexed by Spotlight then.

[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: forman on Jul 06, '05 01:17:21PM

This worked! It fixed the problem even with Exchange folders. After weeks of fighting Mail.app, it finally works. This is so beneficial that you should think about submitting it as its own hint with more details on the installation for those who don't know how to grab modules from CPAN.

Michael.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: foon on Sep 17, '05 02:33:55PM

I agree, please post a full hint with how to set this up. I haven't a clue how to put it together with Mail, but it sounds like something I desperately need.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: carlivar on Jan 10, '06 09:45:49PM

I've modified this script to do nothing but change IMAP LIST commands sent by Mail.app to LSUB instead. LIST lists all folders; LSUB only lists subscribed folders. So, run Thunderbird or another email app to set your folder subscriptions, then use Mail.app normally with this script.

I've sent my changes to Lars and hopefully this will be a command-line option in his excellent script soon.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: carlivar on Feb 06, '06 12:17:41PM
Stop Mail.app from caching too many IMAP folders
Authored by: tcbeatie on Apr 14, '06 10:54:06AM

first of all, thanks to you and Lars for trying to fix this. I've been becoming more and more frustrated with Apple.

second, I tried to do this, and have not been successful. I've got my mail sitting on a UNIX server running IMAP. I have local filtering on the server using procmail rules. my mailbox is under /var, and I have sorted mailboxes under ~/Mail.

Mail.app pulls up not only the /var mailbox, but everything in my home directory and below, including dotfiles, caches, etc. I want to filter out everything except the ~/Mail directory.

I installed your script, I left the local port as 1143, putting in my server as appropriate. I then used Thunderbird per your suggestion, connecting to localhost:1143, and selected my subscriptions.

I then opened Mail.app, reconfigured it to use localhost:1143, and then at first it didn't appear any different, all of the homedir files were there. I tried quitting and restarting, and now it crashes every time after it asks for my IMAP password.. I've got a crash report if that helps, but don't want to post it since it's long.. help?



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: brunchboy on Apr 24, '06 12:52:15PM

You don't need to do any external filtering or subscription to handle this. Mail can already cope. You just need to tell it to use an IMAP mailbox prefix of "Mail".

Edit the account, go to the Advanced tab and type Mail into the IMAP Path Prefix: text box.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: Anoble on Jun 28, '05 06:39:02PM

I can't seem to get it to work with an "Exchange" type account. Different animal or am I going about it the wrong way?



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: lynxie on Jun 29, '05 11:54:44AM

Hm... We have a Public Folder on our Exchange server accessible to everyone, so Mail.app checks and caches all those messages, calendar events and attachments (10000+) at every start, which is not very nice when I'm on dial-up.
The way I got around it was to close Mail, open Library -> Mail -> Exchange Account -> Public Folders and erase its content. Then I went ahead locked the folder and set the permissions to "No Access" for me, group and others. Now even if I click on it, Mail doesn't query the server for info. A bit of an overkill, but I really dislike the Public Folders...



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: moritzh on Jun 29, '05 01:26:17PM

Already in 10.3 I replaced the "Public Folders" folder with a symbolic link to /dev/null. This at least prevents useless stuff from the folders to be written to my disk, waste space and get indexed by Spotlight. But still the folders are queried. Also tried your approach with chmod 000 and locking, and seems to do exactly the same thing: No messages are stored, but the folders on the server are still queried. Or that's what I think because if I delete all caches and force Mail to update everything, it initially shows 0 new messages in the public folders, but later ~100'000. Can you confirm? I am using an Exchange Server but I'll try later and set up the account as plain IMAP instead (don't think this will help, but let's see).

I really hate that Mail.app doesn't let you subscribe to/unsubscribe from IMAP folders. Any decent mail program can do that. Already complained several times to Apple about it.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: moritzh on Jun 29, '05 01:52:09PM

Just a quick update: Also tried it with my acount setup as IMAP rather than Exchange Server, but I got the same results.

But I realized that setting it up as Exchange server is much better (for me at least) because as IMAP I get many error messages during synchronisation regarding some of the public folders that I don't seem to have permissions to view. I need to dismiss every single one of them by clicking OK, and there are many. Set up as an Exchange Server, Mail.app seems to silently ignore those folders (so it seems at least - unlesss this is a once-only thing and I did that when I initially set up my Exchange account [can't remember, I changed setting so often recently]).



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: lynxie on Jun 30, '05 11:19:23AM

Yep, I just checked, you're right it still queries the server, both wen configured as an IMAP and an Exchange client. Maybe it's the placebo effect, but it feels a bit faster when I have the folder locked and 000oed.



[ Reply to This | # ]
Not so
Authored by: jorn_k on Jul 19, '05 12:00:51PM
This hint is untrue.

I wish this were not the case, but simply deleting and/or locking the ~/Library/mail/[user@somedomain.com]/Public Folders/ does not stop mail.app from querying those directories on the server. Just watch the Activity Viewer and you'll see it Getting unread count for mailbox "Public Folders/". This is exactly what I do not want.

The only way that I can imagine to get the desired effect here is for mail.app to support the very standard ability to subscribe/unsibscribe to different IMAP directories. So far, Apple has yet to implement this.

Somebody, please correct me here. Please.

[ Reply to This | # ]
Restrict access?
Authored by: the_chuck on Jul 26, '05 03:24:02PM

Instead of deleting the offending folder, why not turn off access to it? Select the folder, go to File and then Get Info. Under "Ownership and Permissions," set it to No Access.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: yogieric on Aug 23, '05 02:22:58PM
I tried to call Apple-support and they said apple was unaware of the problem and that it would take multiple people reporting bugs before they fixed it. I filed a bug. Here's the correct way to file a bug:

1. Create an apple developer account (they're free and you don't have to be a developer):
http://developer.apple.com/membership/?nav (click "Join Now")
1b. You will get an email and have to confirm you setup your account properly.
2. File a bug:
https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa (login and then select "new problem")

I recommend you include a link to this page.

This bug is a major problem IMHO. Every company I've worked at for the past 10 years has had exchange with huge public folders. My PowerBook G4 1.25GHz spends 30-50% of its CPU most days and nights running Mail alone.

I just installed the latest security patch which brought mail from 10.4.2's 2.0.2 to 2.0.3. The problem is not resolved. I think the best solution is probably to go back to 10.4.1 at this point. And maybe backup Mail 2.0.1 and see if it will run under 10.4.2+ releases. This is not a task I look forward to... I'll probably stop at an apple store and try and get one of their guru's walk me through it.

BTW, my setup in mail is to configure my exchange account as an IMAP email account. I've had no problems with that configuration unlike one other user that chimed in here.

[ Reply to This | # ]

Stop Mail.app from caching too many IMAP folders
Authored by: Carphunter on Aug 30, '05 04:39:12PM

I went ahead and created a bug report... but it just got marked as Duplicate and they don't acknowledge if they're looking at the problem.


The big problem from my point of view is that when Mail hammers the Exchange server, it generates a huge number of errors (even though at the Mac's end...everything seems hunky dory). Our Exchange admins have already decided that if they see Macs coming in with Mail...they'll shut off the mail account so they don't have to deal with the server problems.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: Carphunter on Nov 02, '05 05:41:11AM

Just an update... Mail 2.05 included with 10.4.3 still hasn't addressed the problems. Server still fires off millions of errors.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: alan-trewartha on Oct 25, '05 06:43:47AM

YOU ARE TOTALLY SPOT ON. we are resisting a move to tiger with our ~100 clients until Mail can deal with IMAP/exchange accounts correctly. this IMAP scope issue is an absolute pain.

we tried the perl workaround (above) to no good effect yet (actually to a BAD effect, but that was accidental)

so thanks for the bug submission



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: sjk on Oct 25, '05 07:53:36PM

I'll be reporting this, too, hopefully incrementing the duplicate counter closer to what's necessary for Apple to take action and fix it. I'm eventually migrating from Mulberry (sadly, its company recently filed for bankruptcy) and this is one of several key IMAP-related issues that need fixing before I'd seriously consider Apple Mail as a replacement. With some help from Cyrus Daboo (orĀ other equally talented, experienced IMAP expert) as a technical consultant Apple might get the half-baked implementation closer to being fully cooked.

Excluding Mulberry, Thunderbird may have the best IMAP support of any OS X mail client right now but I'd rather not use it for reasons that are important to me. Unfortunately other choices go down hill quickly. There may be hope for Qualcomm's Cocoa re-implementation of Eudora but a public beta hasn't been released yet.

E-mail is the world's most popular online service yet finding an acceptably tolerable client (it needn't be perfect) remains frustratingly elusive for me.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: ajmas on Jul 23, '08 06:10:43AM

While this is an old posting, it turned up in a Google search, so I just wanted to add my 5c worth:

In Mail.app, in MacOS X 10.5 at least, open the settings for the IMAP account your are interested in and adjust the setting for "keep copies of messages for offline viewing" to your needs. If you select the last option, which is "don't keep copies of any messages", this will stop the application from caching any messages.



[ Reply to This | # ]
Stop Mail.app from caching too many IMAP folders
Authored by: cygraham on Jul 04, '10 06:14:28AM

Has there been any fix for the problem of public folders showing up in Mail? I use Mail to read my work email via IMAP. The server at my university has lot of public folder that I do not even have access to. Mail is constantly checking and downloading mail for these folders, which I sure is slowing up the application (and there are thousands of emails being downloaded).

There were a number of posts about this a few years ago, but I haven't seen a solution to this. I use OSX 10.5.8.

Any help would be appreciated!



[ Reply to This | # ]