The `expunge` method in the `IMAPClient` module of Python's `imapclient` library is used to permanently remove messages marked for deletion from the selected mailbox on an IMAP server. When a message is marked for deletion using the `delete_messages` method, it is actually just flagged for deletion and is not immediately removed. These messages remain in the mailbox until the `expunge` method is called explicitly, or when the connection to the server is closed. This method efficiently expunges these messages, permanently deleting them from the mailbox, and updating the mailbox status accordingly.
Python IMAPClient.expunge - 27 examples found. These are the top rated real world Python examples of imapclient.IMAPClient.expunge extracted from open source projects. You can rate examples to help us improve the quality of examples.