MozillaZine

Deleting messages in IMAP accounts

From MozillaZine Knowledge Base

This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

It is perfectly appropriate for a deleted message in a IMAP account to be visible in webmail or other email clients. Deleting a message just sets a flag, and it's up to the GUI what it should do when there is a message with that flag set. However, once Thunderbird compacts (expunges) that folder, the deleted message shouldn't be visible any more from webmail or any email client because it has been physically deleted.

IMAP accounts provide several options to delete messages that aren't available in POP accounts. Tools -> Account Settings -> Server Settings -> "When I delete a message" has choices for "Move it to the Trash folder", "Mark it as deleted" and "Remove it immediately".

Contents

Move it to the Trash folder

"Move it to the Trash folder" is very similar to deleting a message in a POP account. The main difference is that if you set mail.imap.expunge_after_delete to true using the Config editor Thunderbird will compact the folder after it successfully copies the message to the trash folder. [1] The same thing occurs if you move a message to another folder since moving a message deletes a message and then copies it.

Shift+Delete deletes the message without copying it to the trash folder, and is also supposed to compact the folder (if you have that preference set). However, some users report that Shift+Delete doesn't always compact the folder. [2]

If you want Thunderbird to ask for confirmation when emptying a trash folder, set mail.imap.confirm_emptyTrashFolderDeletion to true.

Remove it immediately

"Remove it immediately" doesn't actually remove the message despite its name. It just hides it from view and flags the message as deleted. That appears to be because Thunderbird doesn't support the optional UID Expunge command, which requires the server to support the optional UIDPLUS capability. It will be physically deleted when you compact the folder.

Mark it as deleted

The main difference between "Mark it as deleted" and "Remove it immediately" is that it doesn't hide the message, and disables automatic expunging of the account (if its enabled) . It draws a line through the message in the folder listing. You can undelete the message by deleting the message again.

Misc

Tools -> Account Settings -> Server Settings -> Clean up ("Expunge") Inbox on Exit will compact the Inbox folder when you exit Thunderbird. If you check "Empty Trash on Exit" it will also empty and compact the Trash folder when you exit.

The Penelope extension and Eudora have a mail.imap.expunge_option that provides auto-expunge like the original Eudora [3]. It was later on added to Thunderbird 3. [4]

  • 0 means it will never occur
  • 1 means it always occurs
  • 2 means expunge the deleted messages when there are at least 20 messages waiting to be expunged. You can change the threshold using mail.imap.expunge_threshold_number.

Some IMAP email providers (such as Yahoo [5]) periodically remove any messages in your Trash folder, and don't let you control when this happens.

See also

External links