Instant Expunge is a site-configurable setting that makes Citadel's IMAP service behave in a sensible way when deleting messages, as opposed to the behavior defined by RFC 3501.
The IMAP protocol does not have a direct way of deleting messages. Instead, the client must set a “Deleted” flag on any messages which are to be deleted, and then perform an “Expunge” operation afterwards to actually delete the messages from the mailbox. It was designed this way because the reference implementation (UW IMAP) stores entire mailboxes in flat files, and deleting a single message requires rewriting the entire file. Rather than fix the limitations of this message store, Mark Crispin decided to implement a workaround and then define that workaround as part of the standard. By “expunging” a mailbox at a later time, the file is only rewritten once.
Obviously, this functionality is obtuse and unnecessarily complicated for any other mail system, particularly one such as Citadel which stores messages in a database. Therefore, Citadel implements two features which compensate for the presence of the “expunge” semantics:
1. When a mailbox is closed, an implicit expunge operation is performed. This prevents deleted messages from mysteriously re-appearing later.
2. If the “instant expunge” site definable setting is activated, setting the “deleted” flag on a message causes an “expunge” operation to be performed automatically. The IMAP client software will be notified asynchronously of this operation, as if it were performed by another client.
When should you activate “instant expunge?” The short answer is, almost always. Modern IMAP clients have no use for “flagging a message as deleted” anyway – they typically move deleted messages to a trash folder, allowing the user to move those messages back later if desired.
Definitely try out the “instant expunge” setting, and only deactivate it if it causes problems with your client software. Most of the popular IMAP client packages have been tested with the option turned on, and we have found that they typically behave very well (usually better) this way.