Filed under: Software, Tips and tricks, Bugs/Recalls, Troubleshooting, Snow Leopard
Getting bit by the Gmail "exceeded IMAP bandwidth limits" bug

Both Mail and the iPhone initially reported that either my password or username was incorrect, but after restarting my MacBook Air, the message changed to what you see above. While I had been sending some large files through email last week, I wasn't using anywhere close to the 2 or so GB per day of bandwidth that Google allows.
A quick search revealed that there's a known bug where accounts are locked out for exceeding IMAP bandwidth limits when using Apple Mail under Snow Leopard. To quote Google's support page,
This is a known issue for users of Apple Mail on the Snow Leopard OS. We are working with Apple on a resolution to the issue. In the meantime, there are a few workarounds to reduce the likelihood of hitting the bandwidth limit:
For my business, I keep my email client up and running most of the day, so the third workaround was not an option. Syncing attachments is easy to turn off in Apple Mail Preferences for Gmail IMAP accounts by selecting "All messages, but omit attachments" under "Keep copies of messages for offline viewing" on the Advanced tab, but it didn't resolve the problem.
- Do not sync attachments.
- Reduce the number of folders you sync by using the Advanced IMAP Controls tab in Gmail.
- Close your email client when you are not using it.
I fortuitously noticed that my MacBook Air seemed to be losing a lot of disk space, and searching the ~/Library/Mail folder indicated that the issue seemed to be in the "Recovered Items" Inbox for this Gmail account -- something I didn't even know existed! It was taking up a whopping 18.66 GB of space, so I went into Mail and deleted the "Recovered Items" inbox.
While this didn't fix the issue immediately, it did eventually allow the account to come back on line with no problems. All told, I was without Mail.app and iPhone access to the account for four days, but at least I could check my Web mail occasionally to see what was coming into the Gmail account.
If you're running Snow Leopard and get bit by the "bandwidth bug" with a Gmail account, I hope that this tip can help you out.

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
KP said 3:06PM on 11-21-2009
Thanks for the post. I also use that setup with Google Apps. Haven't seen this issue yet, but now I will know what it is. I only sync a couple folders, maybe that's why I haven't had it.
Reply
Rob Bahd said 3:45PM on 11-21-2009
I believe that this is fixed in 10.6.2
Reply
guy said 1:18AM on 11-22-2009
Hey!
I would really appreciate it if someone could be point me how to choose which IMAP folders to sync. Can't seem to see a way of doing it, on Mail nor on Gmail.
thanks in advance!
Reply
N I T E said 5:22PM on 11-21-2009
You first need to enable 'Advanced IMAP Controls' in the Gmail Labs (in Gmail settings). Then, in Gmail Settings, go to 'Labels'. There, you have 'System Labels' and 'Labels'. You can choose which ones to show in IMAP by ticking the box(es). In 'System Labels', I recommend not ticking Starred and All Mail. For the other 'Labels', it's up to you!
Hope this helps!
Travis said 4:39PM on 11-21-2009
It's not just SL. I've had this problem with one (the one I hardly use ironically) Google apps acct for as long as I've had google apps and I'm running leopard. It's really annoying with no real apparent fix and google support is a joke. May have to sport the $50 for a premier acct in the hopes i get some support.
Reply
marc said 5:06PM on 11-21-2009
> For my business, I keep my email client up and running most of the day, so the third workaround was not an option.
Reply
chunts said 5:08PM on 11-21-2009
Thank you! I had this problem starting a week ago. After troubleshooting for several days (and reading the problem was in 10.6.1 but resolved in 10.6.2), I finally gave up and created a MobileMe account. At least now I can re-access my old email in Gmail and transfer it over...
Reply
marc farnum rendino said 5:08PM on 11-21-2009
> For my business, I keep my email client up and running most of the day, so the third workaround was not an option.
It may be that this is the easiest way for them to say (and assure) "dial back the frequency of checking for new mail".
Reply
Desterado said 10:55PM on 11-21-2009
Hey buddy.
How's it going?
Not to sound like a jerk or anything, but IMAP has no interval for checking emails. It's a constant connection.
Rob said 5:33PM on 11-21-2009
I have had similar problems using GMAIL's webmail (Firefox) under Windows XP.
If someone mails a couple of EMAILS with attachments totalling a whopping 50 MB, GMAIL will start bouncing EMAILS stating that my mailbox is full. But when I check the amount of space I am using in GMAIL, I am only using 2% of all my space.
It looks like the latest updates to GMAIL made by Google are buggy!
Reply
gob bluth said 9:49PM on 11-21-2009
Running 10.6.2. Had this exact problem, to the word. Will try this tip, thanks.
Reply
guye said 1:19AM on 11-22-2009
Thanks N I T E!
I was unaware of that Labs feature
Reply
marc said 7:29AM on 11-22-2009
Desterado:
Very interesting; I was unaware of that behavior - I actually watched via tcpdump and the server actually initiates contact quite frequently.
Thanks for the tip.
Reply
Rob said 10:37AM on 11-22-2009
Another workaround -- Use Thunderbird instead of Apple Mail.
Reply
Dale said 3:58PM on 11-22-2009
Try using Mailplane
Reply
prufrock said 5:38PM on 11-23-2009
There's always this:
https://www.google.com/accounts/UnlockCaptcha?
It lets you reset the account lock. It's haphazard and spotty, but over the weeks I dealt with this problem I did see it work a number of times. Other times it took a couple of hours to apply. Repeating may have helped as well.
Oddly enough, I haven't seen this issue in weeks.
Reply
chris said 7:37PM on 12-15-2009
well thunderbird is not much better i have the same problem with mine tho i has like 5k emails with lots of attachments so that maybe why but up untill just in the last week even with all the attachments it has not been a problem im using thunderbird 3.0 at the moment
Reply
three6degree said 3:15PM on 1-14-2010
Wow, I think it's really weird that everyone in the world but me experienced this problem last year. This just happened to me yesterday and I've been on 10.6.2 since it's release.
I do believe the recovered folders issue is definitely the problem, it would also explain the loss of battery life and some system lag I've been experiencing.
Thanks for posting this, tons of help.
Reply
Nick said 5:19PM on 1-26-2010
I just ran into this as well -- my "Recovered Messages" mailbox was filled with copies of an email that I had previously sent that had some attachments and was taking up gigabytes of space. Unfortunately, in my case, even if I deleted the "Recovered Messages" mailbox, when I re-launched Mail.app it would re-create it and start re-populating it with the same message over and over again.
I was able to find a fix for this particular problem, so I'll share it here in case it helps anyone out. This is a full description of the situation that I encountered:
(1) I sent an email with some attachments in Mail.app.
(2) A day or two later, my IMAP accounts for that Gmail address (the ones in Mail.app and on my iPhone) stopped working and reported the error: "Account exceeded bandwidth limits. (Failure)"
(3) In my Mail.app, there was a new mailbox called "Recovered Files" that contained hundreds of copies of the email that I had sent in step (1). This mailbox was taking up gigabytes of space on my computer. Even if I deleted the mail box, it would reappear and start re-populating with the same message once Mail.app was able to establish a connection to the Gmail IMAP servers.
Here is the solution to the problem:
(1) If you encounter the "Account exceeded bandwidth limits. (Failure)" error, then quit Mail.app and leave it closed (or just disable your Gmail IMAP account if you use Mail.app for other accounts as well) for 24 hours so that Google will reset your IMAP bandwidth limit. At this point, if you have Gmail set up with your iPhone or other IMAP clients, it should work there.
(2) Delete the hidden folder ".OfflineCache" at the following path: "~/Library/Mail/IMAP-@domain.tld@imap.domain.tld/.OfflineCache"* (step-by-step instructions included at end of post in case you don't know how to do this)
(3) Delete the "Recovered Files" Mailbox folder at "~/Library/Mail/Mailboxes/Recovered Messages ([Gmail Account Name]).mbox"
(4) Open Mail.app and try to connect to your Gmail account -- it should now work.
This definitely worked for me -- it seems like Mail.app somehow gets in a wacky state where it thinks it needs to download the same message hundreds of times, which causes the account to exceed its bandwidth limits. Deleting the cache seems to resolve these problems without causing any other adverse effects. Huge thanks to "engibeer" at http://www.google.com/support/forum/p/gmail/thread?tid=4395706bba19fb05 for coming up with the hard part of the solution!
As a side note, I was running MacOS 10.6.2 when I first ran into this problem, so this issue seems to be different from the one that was supposedly fixed in 10.6.2.
----------
* Step-by-step instructions for deleting the hidden folder:
(1) Open Terminal.app (located at Applications->Utilities->Terminal.app)
(2) Type in "cd ~/Library/Mail/IMAP-" (without quotes) and then press the tab key. It should auto-complete to something of the form "cd ~/Library/Mail/IMAP-@domain.tld@imap.domain.tld". If it auto-completes to something much shorter, you probably have multiple IMAP accounts in your Mail.app -- press tab again to see a list of all the matches, type enough characters to disambiguate your Gmail account from the other ones, and then press tab to auto-complete. Once you have the full command, press return.
(3) Type in "rm -r .OfflineCache" and press return.
Reply