Getting Thunderbird to Auto-Expunge Emails

Mozilla Thunderbird is a great email client, however there is one issue that it has by default that drives me nuts. I run an IMAP server for my @bryanstamour.com email addresses. The IMAP server has a Roundcube web front-end for when I want to access my email from a machine that isn’t mine. When working in Thunderbird, when I move an email from my INBOX to a folder (or from any folder to any other folder), Thunderbird doesn’t expunge the emails from their source folders on the IMAP server; it’s only when you close down Thunderbird that the folders get “compacted” and the change is seen on the server. What Thunderbird does do is simply mark the email as deleted and make a copy of it in the destination folder. This is fine behaviour, but if I have Thunderbird running at home (which I do all the time) and access my mail through Roundcube, I still see all of the deleted mails.

However there is a way to get Thunderbird to automatically expunge when mails are moved, and here’s how I got it to work. Open up the configuration editor by clicking on Edit > Preferences > Advanced > General > Config Editor, and set the following values:

  1. Set mail.imap.expunge_option to 1
  2. Set mail.imap.expunge_after_delete to True

Close the editor and restart Thunderbird (just to be on the safe side) and now moving mail from folder to folder happens on the server instantaneously.