CompactOnDelete
CompactOnDelete is a Mozilla Thunderbird extension that schedules IMAP folder compaction to happen when Thunderbird loses its window focus after messages are removed from an IMAP folder. Only those folders with removals are compacted. This is meant to automatically make deleted messages disappear from Outlook and Outlook Web Access on an Exchange server when they are deleted in Thunderbird. Other IMAP servers don't need this extension, and the use of this extension limits your ability to undo as soon as Thunderbird loses its window focus, since compacting a folder clears the undo/redo history.
In version 0.1, the compaction also happens when the selected folder is changed, and I'll try to fix that. Other than that, this extension is good enough to use. A future enhancement could involve detecting which IMAP servers are Exchange and compacting only their folders on Thunderbird's focus loss.