From d01afc74a3d8bb75c7de8fd75d56b3a116c3a2de Mon Sep 17 00:00:00 2001 From: Benjamin Hall Date: Tue, 14 Mar 2023 12:38:21 +0000 Subject: [PATCH] Added expunge to remove all emails flagged for deletion on the inbox. --- src/phpImapReader/Reader.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/phpImapReader/Reader.php b/src/phpImapReader/Reader.php index a45761d..94ed7ff 100755 --- a/src/phpImapReader/Reader.php +++ b/src/phpImapReader/Reader.php @@ -390,6 +390,16 @@ public function deleteEmail($email_id) return imap_delete($this->stream(), $email_id, FT_UID); } + /** + * Expunge all emails that are marked for deletion on the connected inbox. + * + * @return boolean + */ + public function expunge() + { + return imap_expunge($this->stream()); + } + /** * Mark an email as read by given email id. *