How To Use Xpunge 0.2

The extension adds two buttons on the main Thunderbird toolbar, one called "Xpunge" and another one called "MultiXpunge". Notice that the buttons are not visible by default. You will have to manually add them to the toolbar, by following these instructions. Also, if you have not already done so, please read the following notice before installing this extension. The "Xpunge" button works on a single account, while "MultiXpunge" works on multiple accounts. "Xpunge" compacts all the folders of an account (i.e. it has the same functionality as the "File -> Compact Folders" menu item, not the "Compact This Folder" context menu item contained in the popup menu that appears when right-clicking on a single folder), while "MultiXpunge" can be configured to compact individual folders as well as whole accounts. In order to use "Xpunge", you first have to select any folder in an account and then use the button to empty the trash folder and compact all the folders of that account. On the other hand, you do not have to select any folders before using "MultiXpunge", you can do it from any place in the Thunderbird window.

Before you can use the two buttons you will have to configure the preferences of the extension. Open the extensions window in Thunderbird, select the Xpunge entry and then click on the "Preferences" button at the bottom of the extensions window. The "Xpunge Preferences" window contains three tabs, one labelled "Xpunge", one labelled "MultiXpunge" and one labelled "Timer".

The "Xpunge" tab contains two checkboxes that control the "Empty Trash Folder" and the "Compact Folders" actions. The idea behind this extension ever since its conception was to use both actions, however they have been made optional for more flexibility. Both checkboxes are selected by default.

The "MultiXpunge" tab has two separate lists on the left side, one for selecting accounts that will have their Trash Can emptied and another one for selecting accounts/folders that will be compacted. Each list shows a counter that displays the total number of entries it contains. The drop-down list on the top right side contains all the accounts you have set up in Thunderbird and using the two buttons you can add and remove accounts from the list on its left. The drop-down list on the bottom right side contains the complete folder tree of all the accounts set up in Thunderbird and using the two buttons you can add and remove whole accounts or individual folders from the list on its left. The lists do not contain any entries by default so you will have to configure them before "MultiXpunge" can do something.

To add an account/folder, select the account/folder from one of the drop-down lists and click the respective "Add" button. Note that when the "MultiXpunge" tab is displayed, the drop-down lists will display the name of an account but the account is not considered selected (so the "Add" buttons are disabled). You will have to expand a drop-down list and select an account/folder (either the one displayed or a different one) for the respective "Add" button to become enabled. When an account is selected for compacting from the bottom drop-down list, " (whole)" is inserted after its name in the list, whereas a folder is followed by " on " and the name of the account it belongs to. The corresponding "Add" button does not do any checking, so nothing prevents the user from selecting a whole account and also selecting individual folders from that account. No checks are done during compacting either, so in the case just described the selected folders would be compacted twice. It is up to the user to avoid this simple redundancy. Currently you can only add one account (or folder) at a time and of course you are not allowed to add the same account (or folder) more than once.

To remove an account/folder, select the corresponding row from a list on the left side and click the corresponding "Remove" button. The lists do not allow selecting multiple entries. The "Remove" buttons should not do anything when no account/folder has been selected, even if the buttons are enabled.

All entries in all four lists display tooltips when the mouse pointer is placed over them, which contain additional information for each entry. In the (highly unlikely but "you know better") event that you wish to have two accounts with the same name, you can use the tooltips to distinguish them. This is the only case when multiple entries with the same name should exist in the lists.

If you delete an account that has been added to one of the two lists on the left side, the account will probably still be present in the list next time you open the Preferences window (although the account should not be processed if you use the "MultiXpunge" button). However, the deleted account should not be present in the list after you restart Thunderbird.

All accounts/folders are processed in the order they have been added to the respective list. The extension is supposed to skip IMAP accounts if Thunderbird is in offline mode. It also skips emptying the trash folder for NNTP accounts, which do not have a trash folder.

The "Timer" tab controls the timer feature, which is completely detached from the functionality of the "MultiXpunge" button, which means that regardless of whether you are interested in the timer or not, you can just continue using the "MultiXpunge" (and the "Xpunge") button as usual. The timer feature is disabled by default.

The configuration is similar to that of the "MultiXpunge" button, so you will first have to manually add some accounts in order for the timer to actually do something. As mentioned above, the accounts you add here are not connected in any way to the accounts you have configured the "MultiXpunge" button to process.

There are two extra elements in the "Timer" tab. One of them is a checkbox called "Enable the timer only on the first window", which controls whether the timer will be enabled on multiple Thunderbird windows. This applies to main Thunderbird windows (i.e. opened by right-clicking on a folder and selecting "Open in New Mail Window"), not the ones opened by right-clicking on a message and selecting "Open Message in New Mail Window", which do not contain a timer anyway. If this checkbox is checked, only the first window will have a timer attached. In this case, if multiple windows are open and the one that was opened first is closed, there is no way to enable the timer on the rest of the windows for the current session. This is why users who like to have multiple windows open are given the choice to control this. However, enabling the timer on multiple windows and having it active through the preferences, means that there will be a separate timer running on each window opened subsequently, something that will result in the same timer actions (emptying trash/compacting folders) being repeated redundantly.

The other extra element is the checkbox that actually controls the timer ("Xpunge automatically..."), since the timer is activated/deactivated by it. This checkbox has two components, in the form of textboxes. An interval for the first expunction and an interval for subsequent expunctions, both defined in minutes. The intervals can be any integer from 0 to 99999 (which should be more than enough). If both intervals are larger than zero, say 1 and 30, then an expunction will occur 1 minute after the Thunderbird startup, and then an expunction will occur every 30 minutes after that, so at 31, 61 and so on minutes after Thunderbird startup. The user can select to expunge only once per session, by setting the second interval to 0 and the first interval to the desired number. If the first interval is 0 and the second one non-zero, say 30, then an expunction will occur every 30 minutes after Thunderbird startup, so at 30, 60 and so on minutes. If both intervals are 0, no expunction will happen. Both textboxes will reset their value to 0 whenever an invalid number is entered, but as mentioned above a value of 0 deactivates the timer, so the smallest valid interval is 1 minute. Note that when compacting large accounts, 1 minute may not be enough time for compacting to finish, so it is up to the user to define a reasonable interval for the timer.

The timer feature has been implemented in such a way that only the second interval has a "positive" effect on the current Thunderbird session. This means that changing the first interval through the preferences will not have any effect on the current session, unless it is set to 0, in which case the first expunction will not occur if it has not already done so. On the other hand, changing the second interval has both a "negative" (when set to zero) and a "positive" (when set to a positive integer) effect on the current session, and in the latter case the minutes start counting either right away or after the first expunction (if it has not occurred yet).

There is now also a menu for Xpunge, added under the "Tools" menu on the main Thunderbird window, which allows the user to access the Preferences and disable the timer for the duration of the current session. So the "Disable (This Window Only)" menu item overrides the "Xpunge automatically ... " checkbox in the preferences window until Thunderbird is restarted. Note that this menu item acts only as a "disable" option. When it is selected (checked) and the checkbox in the "Timer" preferences is also checked, the timer will be stopped. However, when it is deselected, the timer will not start running unless the checkbox in the "Timer" preferences is checked. Notice that the menu item controls the timer of a single window only, whereas the preferences set up in the Preferences window are shared among multiple Thunderbird windows.

There are a few facts about the behaviour of the timer (the second interval defined in the preferences) that you should keep in mind. The timer does not start running at the time it is set up through the preferences (i.e. when the preferences are saved by clicking on the "OK" button). It runs for the first time after the specified interval has passed. There might also be an added delay of (at most) one minute due to the way the timer is implemented. The same thing happens when the "Disable (This Window Only)" menu item is deselected. If the checkbox in the preferences is checked, the timer will start running after the specified interval. A similar thing also happens when Thunderbird is first started if the checkbox in the Timer preferences is checked. The timer is set up immediately but does not run immediately. Instead, there is a delay equal to the specified interval before it runs for the first time.

Known Issues and Troubleshooting
  • If you are experiencing any problems with your accounts while compacting, take a look at the following articles to check if it is a known issue with Thunderbird. If not, please send me a bug report regarding Xpunge.

  • If you are having problems installing Xpunge or getting it to work as expected, as a first diagnostic step you can try installing it on a new, clean profile (e.g. without installing any other extensions or themes). If the problems do not appear in the new profile, there might be some conflict with settings, themes or extensions in your old profile. If however the problems persist in the new profile, please send me a bug report regarding Xpunge.

  • This extension does not print any messages of its own (e.g. on the status bar) to notify the user when compacting of each account is finished. It leaves this functionality to Thunderbird itself. However, there are known issues with this feature (see Compacting seems to take forever). Another way to see if Xpunge is actually doing something, is to use Expanded columns in folders pane and check that the size of the folders that need compacting does actually change. This is of course an empirical way to do it but it might give you an idea that something is indeed happening.

  • It is recommended to work offline while compacting folders because downloading email while compacting is in progress can lead to corruption (see How to compact folders). Xpunge does not currently take Thunderbird offline automatically when compacting non-IMAP accounts. It is up to the user to go offline before using Xpunge.

  • The lists in the Preferences window do not support multiple selections. The only effect of this is that removing entries from the lists using the "Remove" buttons is now a bit more tedious.

  • Some preference names have changed starting from this version, which means that even if you upgrade from a previous version of Xpunge, you may have to configure the buttons again through the Preferences window.

Contact Info
You can let me know what you think of the extension or report any bugs you may have discovered by sending an email to: xpungetb at gmail dot com.

If you think you have found a bug, please open the "Error Console" in Thunderbird and look for any entries related to Xpunge (if you are using a filter in the console, search for the string "xpunge"). Please attach all such entries in your email reporting the bug to me.

Last Updated: