IMAP plays hide-and-seek with emails, but there's a solution

Sep 23, 2015 14:45 GMT  ·  By
Thundebird, IMAP, Exchange and Smartphone interaction leads to confusion
3 photos
   Thundebird, IMAP, Exchange and Smartphone interaction leads to confusion

The Internet is an increasingly complex place, not just in terms of services but also from a technical standpoint, especially with the advent of mobile devices over the past few years.

Everything that happens on the web, from browsing, streaming and messaging to file sharing, downloads and, more recently, backups, is based on protocols that have long started to show their age.

Efforts from Internet giants like Google and Microsoft are aimed at improving the situation, but given the slow rate of standardization and adoption of new protocols (or even extensions to existing protocols), it looks like the process will take a long time.

Email is one of the oldest Internet-based conveniences, just like most of the protocols used to make it all happen: SMTP, POP3 and IMAP. Today we’ll deal with IMAP, which is currently at version 4 revision 1, as standardized by the 12-year-old RFC 3501.

IMAP - Is Mail A Pain?

Like other old protocols, IMAP’s initial design was based on a set of conditions and assumptions which are no longer true. As such, it includes features that, albeit originally intended as performance optimizations, are now more of a nuisance.

Deleting emails, in particular, is a rather convoluted process: messages cannot be deleted directly, they can only be marked for deletion. The server will delete them only when it receives the IMAP EXPUNGE command from the client. In plain English, that means “permanently remove now all messages marked for deletion.”

This is problematic if you access your mailbox from multiple devices because you might find out that a message deleted from one device will continue to show up on others. It can be particularly frustrating once you throw smartphones and push email into the mix, especially since most of them access email via Exchange (a newer and constantly updated protocol) and will handle emails, including the deletion part, just as expected.

The root of the problem is that all IMAP-enabled email clients send the EXPUNGE command very rarely, for example, only when the user closes the application or once a day (or never, in extreme cases).

Mozilla Thunderbird - The problem and the fix

Such is the case with the popular cross-platform email client Mozilla Thunderbird, but thankfully there’s also a solution, as you’ll see below.

Going into an email account’s server settings panel reveals three possible settings for Thunderbird’s behavior when deleting emails. The default one claims to move unwanted messages to the Trash (or another, configurable folder). We already know that’s not exactly true, otherwise you wouldn’t be reading this right now.

Mozilla Thunderbird account settings
Mozilla Thunderbird account settings

You might be tempted to jump right at the “Remove it immediately” checkbox. Don’t do it, unless you feel like being disappointed, big time. Despite the name, this setting will only cause Thunderbird to hide messages from the list and mark them for deletion on the server. Emails “deleted” this way will continue to show up on your smartphone with a “read” status and, where available, in webmail interfaces with a strikethrough formatting style.

If “Just mark as deleted” doesn’t sound too promising, that’s because it really isn’t. It does the same thing as the previous option but without the hiding part.

As you can see, the solution can’t be found in the obvious places and going through the entire Thunderbird settings window won’t reveal one either. For that, we need to dive into the configuration editor.

You may already be familiar with this feature from Mozilla’s other popular Internet app, the Firefox web browser. It’s basically a long list of (more or less) suggestively named internal values and flags, most of which cannot be accessed from the regular settings window.

In Firefox, it can be quickly accessed by typing “about:config” in the browser address bar. Here, we’ll just click the Config Editor button in Thunderbird’s advanced settings panel.

Mozilla Thunderbird configuration editor with expunge settings
Mozilla Thunderbird configuration editor with expunge settings

Typing “expunge” in the search field will automagically filter the list and show the relevant settings, including the one we’re interested in: mail.imap_expunge_after_delete. By default, it’s disabled (Value=false), but we need it to be enabled (Value=true), which can be done by simply double-clicking on it.

Close and reopen Thunderbird to make sure the new settings are loaded and… that’s it. From now on, Thunderbird will send the EXPUNGE command to the server every time you delete an email, ensuring the message is immediately deleted or moved to the Trash, depending on your preference.

Don’t believe me? Check your smartphone or webmail and be amazed.

Photo Gallery (3 Images)

Thundebird, IMAP, Exchange and Smartphone interaction leads to confusion
Mozilla Thunderbird account settingsMozilla Thunderbird configuration editor with expunge settings
Open gallery