This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Lots of mail stored in ImapMail, why?

  • 8 replies
  • 1 has this problem
  • 1 view
  • Last reply by Tonnes

more options

For a particular user on our system there is 6.1G of mail data stored in the server IMAP folders, and 6.4G stored in$HOME/.thunderbird/[profile]/ImapMail. Why is so much stored in both places? The synchronization setting has "Synchronize the most recent 30 days", yet examining just the Trash folder in ImapMail shows messages over a year old. Preferences > Network & Disk Space has "Use up to 350 of space for the cache."

So, why is so much stored in the local ImapMail folder and what can I do about it? (Thunderbird version 52.2.1 for Linux).

For a particular user on our system there is 6.1G of mail data stored in the server IMAP folders, and 6.4G stored in$HOME/.thunderbird/[profile]/ImapMail. Why is so much stored in both places? The synchronization setting has "Synchronize the most recent 30 days", yet examining just the Trash folder in ImapMail shows messages over a year old. Preferences > Network & Disk Space has "Use up to 350 of space for the cache." So, why is so much stored in the local ImapMail folder and what can I do about it? (Thunderbird version 52.2.1 for Linux).

All Replies (8)

more options

Lots of question in there. The first being you might try setting the store messages for this account on this computer to off. (synchronization and storage in account settings)

You might also look at the retention setting (also in synchronisation anf storage) and set for old mail to be deleted. getting mail is one thing getting rid of it is another.

You might want to also compact the folder occasionally as that frees space in the files released by deleting massages.

more options

Matt, thanks for you reply.

Matt said

Lots of question in there. The first being you might try setting the store messages for this account on this computer to off. (synchronization and storage in account settings)

That does not appear to be an option. I have: "Synchronize all messages ...", Synchronize the most recent <n> Days", "Don't download messages larger than <n> KB". I don't see an option to turn it off and setting Days to 0 isn't accepted. It resets it to 1 (which I'll leave). Will that eventually purge out messages older than 1 day? As I mentioned in my OP, even though it was set to 30 days, I had messages in there over a year old.

You might also look at the retention setting (also in synchronisation anf storage) and set for old mail to be deleted. getting mail is one thing getting rid of it is another.

Unfortunately, not an option. Office policy dictates retention periods and it is up to the user to keep their mail folders cleaned up.

You might want to also compact the folder occasionally as that frees space in the files released by deleting massages.

Under Preferences > Network & Disk Space, I do have the "Compact all folders ..." option checked. Surprising since the ImapMail size is actually larger than the user's uncompressed IMAP folder on the mail server.

Other ideas?

Modified by Mark Foley

more options

Let me get this, you are here asking why there is year old mail in the deleted folders when the office policy specifically disallows the mail client having an over riding setting on what the user wants. This sounds to me like you have office issues that require management decisions, not difficulties with a mail client.

more options

That box was already un-checked. So why is there *anything* in the ImapMail folder? In fact, examining the messages in the various subdirectories I see nothing newer than 2016. Is it possible that when I unchecked that box -- possibly over a year ago -- that Thunderbird just left what was cached out there and never cleaned it up?

Can I safely delete all these files?

Let me get this, you are here asking why there is year old mail in the deleted folders when the office policy specifically disallows the mail client having an over riding setting on what the user wants. This sounds to me like you have office issues that require management decisions, not difficulties with a mail client.

Clarification: I am talking only about the local ImapMail cache and why there are messages in the cache older than the set 30 days (but this is possibly caveated by my comments above. Maybe there's a different reason these are still out there). As to the actual IMAP mail folders on the mail server, they are up to the user to maintain. The mail client cannot decide for the users that messages older than x days should be automatically deleted.

Modified by Mark Foley

more options

Synchronize messages newer than does not mean remove messages older than. Thunderbird will keep whatever messages are downloaded until the server says the message is deleted.

You are also mistaking the local cache for downloaded mail. Mail is the imapmail folder is not in the local cache, it is mail stored locally. They are not the same thing.

I would assume your 6gb of mail is a hang over from the past. The simplest measure is probably to delete the account, and the folders from imap mail and add it again. otherwise if you just close Thunderbird and delete the mail Thunderbird should just go about recreating what is needed om the account settings (A number of MSF files.)

more options

Matt said

Synchronize messages newer than does not mean remove messages older than. Thunderbird will keep whatever messages are downloaded until the server says the message is deleted.

Sorry, but that doesn't make sense to me, if the option says, "To save disk space, downloading messages from the server and keeping local copies for offline use can be restricted by ... Synchronize the most recent 30 days", I take that to mean ONLY the most recent 30 days and messages older than that will be removed. Otherwise, the day value has no point and space is not saved. But if you say so, who am I to argue.

You are also mistaking the local cache for downloaded mail. Mail is the imapmail folder is not in the local cache, it is mail stored locally. They are not the same thing.

So, If I have "Keep messages for this account on this computer" UNchecked, and "Synchronize the most recent 30 days", what is in ImapMail, and where is the "cache"? I still don't understand why there was over 6.4G in ImapMail.

I would assume your 6gb of mail is a hang over from the past. The simplest measure is probably to delete the account, and the folders from imap mail and add it again. otherwise if you just close Thunderbird and delete the mail Thunderbird should just go about recreating what is needed om the account settings (A number of MSF files.)

I tried closing Thunderbird and deleting the files in ImapMail. That didn't work. When I fired up Tbird again I repeatedly get the error, "The current operation on 'inbox' did not succeed. The mail server for account user@mydom.com responded: [SERVERBUG] internal error occured. Refer to server log for more information [2017-07-11 00:38:07]." There is nothing in Tools > Developer Tools > Error Console (if that's where the log is). It did, however, create a number of files in that directory, including MSF files. Nevertheless, I cannot retrieve mail from the server.

Currently I'm trying to restore the ImapMail folder to its state before I deleted its contents. If that doesn't work I guess I'll have to recreate the account -- which sucks because the user has all kinds of calendar settings, tag colors, etc.

Modified by Mark Foley

more options

Now I'm in a real pickle! The restore of the ImapMail directory didn't work. I had the original profile backed up, so I saved the calendar files and deleted and replaced the entire profile. Doing so allowed the current inbox messages to be retrieve (server: Maildir/cur), but none of the INBOX subfolders. I continue to get the "The current operation on 'inbox' did not succeed" message. It says, "refer to server log for more information". Where is this server log?

(later) More information -- This does not seem to be a Thunderbird issue. I've attempted to delete everything and start over with a new profile. I get a kerberos error. If I specify a normal ID and password - it works and I get all the folders.

I'll have to research this ... stand by ...

Modified by Mark Foley

more options

In Account Settings > Server Settings, under the Message Storage section, you see options for expunging the inbox as well as clearing the Trash can on exit. Are these ticked?

More info on deleting messages in Thunderbird can be found on this page. Especially take note of the mail.imap.expunge_after_delete preference. As for the IMAP folders and files structure, it should be very easy to see what messages are remained and causing the excessive storage, but you already found out this is about trash.