Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.ExpungeMailBox
Removes messages marked for deletion in the currently selected mailbox.

function ExpungeMailBox: Boolean;
Returns
Boolean - True on success.

Description
ExpungeMailBox is a Boolean function that permanently removes messages marked for deletion in the currently selected mailbox. Messages marked for deletion contain the Deleted flag.

ExpungeMailBox requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised.

ExpungeMailBox calls the SendCmd method using the IMAP EXPUNGE command, and on successful completion calls the ParseExpungeResultDetails method for the selected mailbox.

ExpungeMailBox sets the return value to True when ResultNo contains the value wsOk.