IMAP Trash folder

From MozillaZine Knowledge Base
Jump to navigationJump to search

Thunderbird assumes that your Trash folder is called "Trash" and not some other name, such as "Deleted Items". This can create a problem if you have a IMAP account and the IMAP server uses a different name for the Trash folder. Thunderbird would create its own Trash folder (named "Trash") while your mail server would use the other folder (e.g., "Deleted Items"), and you might see both folders in the Thunderbird folders pane.

You can rename the Trash folder using a custom-strings.txt file in the optional Chrome directory in the programs installation directory. That file is mainly meant to localize text in the user interface but it can be used to change hard-coded folder names. For example if you wanted to rename the Trash folder to rubbish:

  1. View the C:\Program Files\Mozilla Thunderbird (or your equivalent) directory using Windows Explorer.
  2. Create the Chrome directory if it doesn't exist.
  3. Create a text file called custom-strings.txt in that directory.
  4. Add chrome://messenger/locale/ to that file.
  5. Change Tools -> Account Settings -> Server Settings -> account_name -> When I delete a message -> "Move it to this folder" to "rubbish".
  6. Restart Thunderbird.

Localized versions of Thunderbird sometimes have different names for some of the hard-coded folders. For example the EN-GB (UK) version uses "Deleted" for the Trash folder.

If you want to use "Gelöscht" (German for Trash) you might have to enter it as "Gel&APY-scht", since the German Umlaute has to be encoded differently. See Creating a escaped version of a non-ASCII folder name .

An alternative solution is to use the FolderFlags add-on to flag a folder as the Trash folder. That should work for both IMAP and POP accounts though not for a global inbox (Local Folders).

Old way

To specify a different Trash folder for an IMAP account in Thunderbird:

1. Completely exit Thunderbird if it is running.

2. Make a temporary backup copy of your profile folder (or at least "prefs.js").

3. Open your "prefs.js" file with a text editor such as Notepad to find the server# used to represent your IMAP account. It could be "server2", "server5", "server7", or some other number depending on your own individual account setup. Look for a line similar to this, corresponding to your own IMAP acccount:

user_pref("mail.server.server2.hostname", "");

4. Insert a line like the following into "prefs.js", with the correct server# and correct name for the Trash folder:

 user_pref("mail.server.server#.trash_folder_name", "<correct Trash name>");

For example:

 user_pref("mail.server.server2.trash_folder_name", "Deleted Items");

If you want to use "Gelöscht" (German for Trash) you would have to write it in the user_pref as "Gel&APY-scht", since the German Umlaute has to be encoded differently.

5. Restart Thunderbird. You should now see the new Trash folder (e.g., "Deleted Items") showing the trash can icon. (If not, exit and restart Thunderbird.) If the old Trash folder is still showing, you should now be able to delete it. If you can't delete it through Thunderbird, then delete it through the account's webmail interface.

6. If you deleted the Trash folder in the web front end of your mail provider, you may need to cancel the IMAP folder subscriptions, too. It may take a while for the subscription changes to take effect.


Thunderbird typically relies upon the "Allow server to override these name spaces" setting to specify the IMAP server directory in Tools -> Account Settings -> Server Settings -> Advanced. If these instructions don't work and that field is empty try setting it to "mail". If that doesn't help exit Thunderbird, delete the "Trash." and "Trash.msf" files for that account, delete the panacea.dat file (Mail folder cache) in the root of the profile, and then see if it uses the new trash folder. [1] [2]

Creating a escaped version of a non-ASCII folder name

If the name of your Trash folder has any non-ASCII characters you need to create a escaped version of the name [3]. One way to determine the escaped version is to use a Python-Interpreter:

$ python -c 'print repr("Gelöschte Objekte")' # (German version of Exchange) 'Gel\xf6schte Objekte'

$ python -c 'print repr("Gelöscht")' # 'Gel\xf6scht'


  • The FolderFlags add-on adds a tab to folder properties that lets you change the flags Thunderbird uses to identify certain types of folders.
  • Install it
  • Change the trash folder to whatever you want to use in Tools -> Account Settings -> Server Settings -> When I delete a message -> Move it to this folder.
  • Select the folder you want to use as the trash folder in the folder pane
  • Right click on it and select the Flags tab
  • Check Trash and press OK
The old trash folder should get a normal icon and the new trash folder the trash icon. This appears to work with IMAP and POP accounts, but not Local Folders. Its not clear how well it works if you want to use a folder that has non-ASCII characters.
  • Some localized versions of Thunderbird use different names for the trash folder. For example, the EN-GB (UK) version uses "Deleted". If you normally use the EN-US version of Thunderbird and wanted to use "Deleted" as the Trash folder name you could download the EN-GB version of the setup program from , install it, and then install the EN-US version of the dictionary. This appears to work with all accounts.
  • You could hack the folder name stored within the omni.ja in the Thunderbird installation directory. You'd have to use something like the JAR archive tool or 7-Zip to unpack it, search chrome/en-US/locale/en-US/messenger/ for "", edit trashFolderName=Trash and then repack the jar file. [4] . The obvious downside is you would have to do this every time you upgrade, and each time you do that there is a chance you accidentally break something. Its strongly recommended that you use a different solution.

See also