How To Use Xpunge 5.0.2



Usage
Before using Xpunge, please read this notice and this notice and this notice.

Xpunge allows the user to empty the Trash, empty the Junk and compact folders in any type of Thunderbird account.

It provides 3 "modes" of functionality, "Xpunge", "MultiXpunge" and "Timer". The "Xpunge" mode works on a single account, "MultiXpunge" works on multiple accounts and "Timer" offers a way to process multiple accounts automatically at a specific time every day and at regular intervals from the time Thunderbird is started.

"Xpunge" can empty the Trash and Junk, and compact all the folders of an account. So when it comes to compacting, it provides the same functionality as the "File -> Compact Folders" menu item, not the "Compact" context menu item contained in the popup menu that appears when right-clicking on a single folder. "MultiXpunge" can be configured to empty the Trash and Junk of specific accounts and compact individual folders as well as whole accounts. The "Timer" offers similar functionality to "MultiXpunge" but its settings are completely independent of those of "MultiXpunge". In order to use "Xpunge", you first have to select a top-level account. On the other hand, you can run "MultiXpunge" from any place in the Thunderbird window.


Buttons
The extension makes available one button, called "MultiXpunge", which can be added to the Thunderbird toolbars. If the button is not visible by default, you will have to manually add it to your preferred toolbar by following these instructions. The button offers the functionality corresponding to its name.



Menu
Xpunge also adds a sub-menu to Thunderbird's Menu Bar "Tools" menu, which can be used to call "Xpunge" or "MultiXpunge", and disable the timer.


              


The specifics of disabling the timer are explained later on this page, in the section about the "Timer" tab on the Preferences window.


Preferences
Before you can take advantage of Xpunge's functionality you will have to configure its preferences. You can do this through the wrench icon in the Extensions tab of the Add-ons Manager (accessible through the "Add-ons and Themes" menu entry).





The "Xpunge Preferences" window contains four tabs, labelled "Xpunge", "MultiXpunge", "Timer" and "Settings".


The "Xpunge" tab contains three checkboxes that control the "Empty Trash Folder", the "Empty Junk Folder(s)" and the "Compact Folders" actions. The idea behind this extension ever since its conception was to use all actions, however they have been made optional for more flexibility. The checkboxes for Trash and Compacting are selected by default, whereas the checkbox for Junk is unselected (turned off) by default.






The "MultiXpunge" tab has two sections, one for selecting accounts that will have their Trash Can and/or Junk folders emptied and another one for selecting accounts/folders that will be compacted. The tree for emptying Trash/Junk is always populated with all the accounts set up in Thunderbird and for each account there are checkboxes to select which folders to empty. 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 buttons you can add and remove whole accounts or individual folders from the list on its left. This list does not contain any entries by default so you will have to configure it before compacting.





To select a folder to be emptied, just check the corresponding checkbox. To add an account/folder to the compacting list, select it from the drop-down list to the right and click the "Add Selected" button. You will have to expand the drop-down list and select an account/folder for the "Add Selected" button to become enabled. When an account is selected for compacting, " (whole)" is inserted after its name in the list, whereas a folder is displayed separated by " / " from the name of the parent account (e.g. Local Folders / Deleted). 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. You are not allowed to add the same account (or folder) more than once.





To stop a folder from being emptied, just uncheck the corresponding checkbox. To remove an account/folder from compacting, select the corresponding row from the list on the left side and click the "Remove Selected" button. The list does not allow deleting multiple entries. You might be able to select multiple entries, but only the first one will be deleted.





For the emptying functionality, there are buttons labelled "Add All Trash", "Add All Junk", "Remove All Trash" and "Remove All Junk", which allow you to check or uncheck all the corresponding checkboxes at once. For compacting, there are buttons labelled "Add All" and "Remove All" that allow the user to add or remove all the accounts from the list. The entries added to the "Accounts/Folders To Be Compacted" list consist of a single entry for each available account (currently denoted as "whole"). Only the accounts that do not already exist are added. If the list already contains folder entries, these entries are not removed.

The buttons for the emptying functionality are always enabled, whereas the ones for compacting become enabled/disabled according to where the user clicks on the window.

All accounts/folders are processed in the order they have been added to the respective list.



The "Timer" tab controls the timer feature, which is completely detached from the functionality of the "MultiXpunge" button. This 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" tab, 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. They are checkboxes that actually control the timer, since the timer is activated/deactivated by them. They are unchecked by default and they actually remain disabled until at least one account/folder has been added to one of the two lists on the left.

The "Xpunge automatically ... minutes after startup ..." checkbox will be referred to as the "relative" timer and consists of 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 minutes and so on 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 minutes and so on. If both intervals are 0, no expunction will happen. 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 "Xpunge automatically every day at ..." checkbox, also known as the "absolute" timer, can be used to define a specific time of the day when expunction should occur. The time is defined in 24-hour format using the corresponding input fields for the hour and the minute. This timer feature is completely separate from the "relative" timer, so they can both be set at the same time. No check is performed for times that overlap.





The "relative" timer 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). The "absolute" timer has been implemented in such a way that changing the defined time takes immediate effect in the current Thunderbird session, so no restart is required.

The timer can be disabled for the duration of the current session through the "Timer" sub-menu of the Xpunge menu. So the "Disable Relative Timer" menu item overrides the "Xpunge automatically ... minutes after startup ..." checkbox in the preferences window until Thunderbird is restarted. Similarly, the "Disable Absolute Timer" menu item overrides the "Xpunge automatically every day at ..." checkbox in the preferences window until Thunderbird is restarted. Note that these menu items act only as "disable" options. When they are selected (checked) and the corresponding checkbox in the "Timer" preferences is also checked, the corresponding timer will be stopped. However, when they are deselected, the corresponding timer will not start running unless the corresponding checkbox in the "Timer" preferences is checked.

There are a few facts about the behaviour of both the "relevant" and the "absolute" timer that you should keep in mind. The "relative" timer (its second interval) does not start running at the time it is set up through the preferences (i.e. when the preferences are saved). It runs for the first time after the specified interval has passed. The same thing happens when the "Disable Relative Timer Relative Timer" 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. Also note that due to the way both timers are implemented, there might be a delay of (at most) one minute, compared to the defined time, before expunction occurs.



The "Settings" tab currently contains two sections, one for Xpunge and one for MultiXpunge. The only option currently available is to enable a confirmation dialog when Xpunge or MultiXpunge is called. There is no confirmation dialog option for the timer feature. The confirmations are a precautionary measure in case the MultiXpunge button is pressed by mistake or the menu items are selected by mistake. Both options are disabled by default so that they do not interfere with the setup of previous Xpunge releases, but any user who wishes to enable them can easily do so here.

NOTE: Thunderbird has its own default confirmation prompt popping up when trying to empty the Trash/Junk, with the message "Delete all messages and subfolders in the ... folder?". This prompt is completely unconnected to the Xpunge settings and can be disabled/enabled independently.







Known Issues and Troubleshooting
  • In TB 128 with Xpunge 5.0.2, there are mixed reports about whether emptying the trash/junk of exchange accounts works. And the compacting of exchange accounts/folders does not work.

  • Some users have reported an issue in Thunderbird 102, where email accounts are "forgotten" in the preferences of "MultiXpunge", so they are no longer being compacted or their trash/junk emptied. After upgrading to Thunderbird 102, please double check your current setup in all tabs of the preferences page of Xpunge. If your accounts/folders are still not processed by Xpunge, try reconfiguring Xpunge, by removing all your accounts/folders from the setup of Xpunge and adding them again.

  • Some users have reported an issue in Thunderbird 91, where they install Xpunge 3.0.0 but MultiXpunge still does not work, with an error about "fixIterator" appearing in the Error Console. This seems to be an issue with Thunderbird 91 caching and using Xpunge 2.1.1, even though 3.0.0 is installed. Disabling and enabling Xpunge 3.0.0 again might solve the issue.

  • There is a known bug in Thunderbird 78 that might cause the "MultiXpunge" button to "disappear" after restart (go back to the Customize Toolbar) if the button has been added to a different toolbar than the Mail Toolbar.

  • In certain cases of compacting, Xpunge may display the following message in the Error Console: "TypeError: this._resetThreadPane is not a function". This error comes from an internal function of Thunderbird, so Xpunge cannot do anything about it. Still, it does not seem to affect compacting, so the corresponding account should be compacted successfully despite this error. Those who are comfortable with tweaking Thunderbird (warning: try at your own risk), can verify that this error does not come from Xpunge by following the instructions for enabling dump output and using Thunderbird's "File -> Compact Folders" menu item instead of the Xpunge button. The same error message should appear in the console (not the Error Console).

  • For the core functionality of emptying the trash/junk and compacting accounts/folders, Xpunge is just a proxy to Thunderbird functionality. So it uses functions made available by Thunderbird. Since version 5.0.0, Xpunge has started using different Thunderbird functions, specifically the ones that are available via the WebExtension APIs.

  • This extension does not print any messages of its own on the Thunderbird status bar to notify the user when compacting of each account/folder or emptying the trash/junk is finished. It leaves this functionality to Thunderbird itself. Another way to see if Xpunge is actually doing something, is to select "Show Total Message Count" and "Show Folder Size" from the options for the folder pane. This is of course an empirical way to do it but it might give you an idea that something is indeed happening.

  • 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.

  • Compacting folders in Thunderbird can have some undesired complications. See the "Potential complications" section in Compacting folders. 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.

  • It used to be recommended to work offline in Thunderbird while compacting 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.

  • Thunderbird may identify multiple folders as being junk folders. When Xpunge empties the Junk of an account, it will not just empty the folder called "Junk". Instead, it will empty all folders that are identified as storing junk messages. For example, the default junk folder of a Gmail IMAP account is called "Spam". If this account is setup in Thunderbird, there is the option to move all junk messages to a folder called "Junk". So if Xpunge is instructed to empty the Junk on this account, it will empty both the "Spam" and the "Junk" folder.

  • Thunderbird has a default confirmation prompt popping up when trying to empty the Trash or the Junk folders, with the message "Delete all messages and subfolders in the ... folder?". Please do not confuse it with the confirmation prompt controlled through the Xpunge settings. The prompt from Thunderbird is completely unconnected to the Xpunge settings and can be disabled/enabled independently.

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, open the "Error Console" in Thunderbird (Tools → Developer Tools → Error Console) and look for any entries related to Xpunge. Please attach all such entries in your email reporting the bug to me, but first make sure to hide any sensitive information, such as email addresses.




Last Updated: