How to Permanently Remove Messages Marked as Deleted

Deleting an email using an IMAP email client, marks the message as deleted.
How to ensure that messages are permanently deleted?

Solution

When you mark an item on an IMAP e-mail server for deletion, the item is displayed in strike-through text in the header list. However, the item is not removed from the IMAP mail server until a purge command is used.

To permanently delete an email message, the IMAP client must perform an Expunge action on the required emails. The Expunge operation can be performed via the related IMAP command. Each email client has an option to set the behavior for the Expunge operations (example: Purge action for MS Outlook, Compact or Expunge action for Mozilla Thunderbird). This is generally performed during the email client exit.

A complete tutorial on how to purge deleted items for Outlook is available at:

http://office.microsoft.com/en-us/outlook/HP100804201033.aspx

For Mozilla Thunderbird right-click on the account go to Properties, Server Settings and from the drop-down box related to "When I delete a message" you can select several options: "Move it to the Trash folder", "Mark it as deleted" and "Remove it immediately".
Also under the Server Settings tab you can find related options like: "Clean up (Expunge) Inbox on Exit" and "Empty Trash on exit". From this section choose the behavior that best meets your requirements.

You can also perform an Expunge operation, in Thunderbird, on a single folder by right-clicking the respective folder and selecting the "Compact" action.

Note: In order to just hide the messages marked (flagged) as Deleted, in the Webmail interface, you can use the "Hide deleted" action available in the Webmail folder content view.
OS: LinuxWindowsFreeBSDNetBSDOpenBSDSolaris
Distros: WindowsDEB based distros amd64FreeBSD 7.x