I've fixed this problem on a few different accounts by editing Mail's preferences file, located at
~/Library/Preferences/com.apple.mail.plist Quit mail, then drag a copy of the file to your desktop for backup. Use Property List Editor from the Developer Tools to edit the file (I'm not quite sure how to do it via the Terminal). Open _Root/Mail Accounts_ and find the account you're having trouble with among the list of numbers. Change the property
ToDosMailboxName to just _Apple Mail To Do_ It probably has one or more /INBOX/ entries in it already, which is what's causing the problem.
Before opening Mail back up, delete the offending folders from
~/Library/Mail/ The only to do folder/mailbox that should remain is _~/Library/Mail/IMAP-youremailaddress/INBOX/Apple Mail To Do.imapmbox_
Proceed at your own risk of course, you may want to backup your whole
~/Library/Mail/ folder before trying this anyway.
Now if I could just figure out how to get rid of this folder altogether. I don't use to do's, and unlike notes and all other folders I can't seem to just turn it off.
These actions are more persuasive than those listed elsewhere and apply to IMAP mail accounts only. Particularly step 4 and 5
1. cut network on mac, quit mail, cut off your iphone/itouch
2. open the webmail access to your mailbox.
3. delete the intrusive .inbox.inbox folders
4. on you mac open the com.appl.mail.plist
5. search for the intrusive item (typically in MailAccounts/Item there is asomething within inbox.inbox)
6. correct the item
7. Ideally delete the library/mail folder (careful people will do a backup)
8. kill network connections on you mac
9. start mail
10. sometimes the subfolder still needs to be deleted, delete it
11. activate network on mac and resynch mail
12. check
13. activate network on iphone and resynch mail
The real action is step 4 and 5, apparently the latest release generates a crazy entry in the prefs file.
I would just like to add that APPLESTORE GENIUSES should not recommend deleting the mailbox on the web mail hoster. Which is the advise I received, and did not follow - obviously
I fixed this by opening up the plist described above, editing the line with the multiple Inboxes (in my case it was the drafts folder. Saved it. Open up Mail, rebuilt the mailbox and the problem was resolved. I also added a blank To-Do as a precaution and will just let it sit there.
The only thing that I didn't understand was instruction number 8: "kill network connections on your mac".
I wasn't sure what the writer had in mind here –– I just turning off my AirPort card, which should presumably 'kill' the network connections. If you had something else in mind, I'd be interested to know.
Anyway, this did seem to work. Seems like it will be a temporary fix that may need to get repeated until they fix the underlying bug.
I had this problem with the 'Deleted Messages' folder and seem to have solved this (at least for now...) by editing the com.apple.mail.plist entry for the offending account to add INBOX/ before each of the folders (which for some reason wasn't there even though it was set in account preferences in Mail) and then in Mail deleting all the nested inbox folders starting at the lowest level otherwise you get an error that the folder doesn't exist.
Amigafans solution is great, it works fine temporarily but apple just creates the files again. I'd like to write a short script to run on my server to do just this. What is the best shell command to *remove a line of text from a text file* that meets a specific criteria? (Like INBOX.INBOX*)
i am having this same problem... email hosted at dreamhost, using mac mail v 3.5 currently on 10.5.6, but have had this same problem as long as i have had dreamhost (3 years over various os x versions and email app versions). i have 2 other imap accounts in mac mail and neither have ever had this problem. i can delete the inboxes from my webmail, mac mail, night, day, summer, winter, etc etc but they always come back to haunt me. i am so sick of deleted renegade inboxes that i am definitely thinking of switching to a different email desktop client all together. really frustrating that this problem has not been addressed by apple as of yet.
I edit the mail plist file and the extra Inbox, Inbox.deleted messages, and inbox.sent messages just keep coming back.
if i delete them off of my webmail they are gone until I send or delete off of apple mail!!
apple please fix this!!!!!
I'm also having these similar problems. I searched the web and even spoke to tech support from my email server, and apparently the directory modifications are being uploaded from either my Apple Mail Client or iPhone.
I tried all the suggestions here (well at least the ones I understood) with no luck.
still no answer to this problem???
For one week I used just my iphone and webmail to access my e-mail and no problems. as soon as I return home and use Apple mail this problem returns. and this is after editing the mail.plist file. so something in Apple mail is causing this, and it would be nice to clear this up.
delete: .../library/preferences/com.apple.mail.plist
delete: .../library/mail/"infected mail folder"
After that, go to webmail and delete all those inboxes. Then, in Mail -> Preferences, you have to add your account again. And, voila, problem solved
I did that a couple of months ago and everything worked fine until the 10.5.7 update. I repeated the trick and it solved the problem again. Making a backup isn't necessary, as long as you mail is saved at your server.
OK, I ran into this problem with my two IMAP accounts hosted at SpamArrest. My Mac and GMail accounts seemed fine.
After many different attempts to fix this problem, only to have the folders come back I learned something about IMAP. The IMAP server keeps a list of called "Subscriptions" which lists the folders to which you are subscribed -- even if those folders don't actually exist on the server. I think there are cases where the Mail.app will actually subscribe to folders that it never actually asked the server to create or the create process failed in some way.
The gist is you have to clean up the subscription list on the server. Here is how I did it.
1. Archive the mailboxes for the accounts having a problem - just a precaution.
2. Delete the IMAP account from each computer that accesses it. In my case it was iMac, MBP and iPhone. This may not have been necessary but since it's IMAP I felt it was safe to be thorough.
3. Shut down Mail.app on all computers and turn off you iPhone, if you have one.
4. Download and luanch Thunderbird Mail app.
5. Configure Thunderbird to access the IMAP account in question.
6. Note the extraneous folders -- I clicked on each and deleted them to move them to the Trash folder. For many of these folders, if I clicked on them, Thunderbird will tell you there is no folder associated with it on the server.
7. Find the "Subscribe..." menu item and wait for it to download the folder tree. Unsubscribe from all the folders you moved to Trash (or if not, the ones you want to go away).
You could trim out some steps if you want but that's what I did to get ride of those bogus IMAP folder subscriptions. The gist is that once you clean up the subscriptions list on the server, when Mail.app connects for the first time after you create the account, it will only subscribe to the set of folders that actually exist (assuming you cleaned them up properly).
Also, be careful not to delete a folder you actually use. I think my set included Inbox, Drafts, Deleted Messages, Sent Items, Sent Messages, Trash, Apple Mail To Do, and three Archive_* files.
I did an archive of my whole ~/Library/Mail folder as its just a good idea anyway.
The first thing I did was remove the offending INBOX.INBOX.etc entries in com.apple.mail.plist.
Second (before relaunching Mail) I fixed your IMAP subscription problem but in a lazy way... I merely went into the problem account via web mail (Squirrel Mail in this case) and unsubscribed the offending folders. I restart Mail (3.5 - 930.3) and boom , the folders are there and then are instantly removed and Mail syncs everything exactly as it should. Curiously, Mail strikes me as snappier now; perhaps the bad subscription entries were introducing unnecessary synchronization steps?
Whether this fixes it permanently or not is another issue, but I think you were right on about the 'IMAP subscriptions' and that its a setting that is on the server. My guess is that Apple Mail is interacting with that in unsuspecting, possibly buggy ways, but to be fair this may not be all Apple's fault.
It reminds me of the headache I initially had with Apple Mail whining every time I started it about certificate mismatches. Well, in fact, that was a FEATURE that every mail program should have but most don't. In my case it was telling me there was a domain-cert mismatch with my setup and I had permanently tell Mail is was ok to assume it was a proper server.
Thanks so much, if the problem appears again at least I know how to clean it up.