From 80e769d01b9d0c6130962e3a1e00352f622907e0 Mon Sep 17 00:00:00 2001 From: Dale Allan Date: Tue, 10 May 2016 11:46:43 +0200 Subject: [PATCH] Add function to fetch and clear imap errors --- src/Fetch/Server.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Fetch/Server.php b/src/Fetch/Server.php index 32e57c1..a90c7e7 100644 --- a/src/Fetch/Server.php +++ b/src/Fetch/Server.php @@ -439,6 +439,16 @@ public function getMessageByUid($uid) } } + /** + * This function returns all the imap errors to prevent the following + * warning from imap_close and imap_expunge + * 'Unknown: Warning: MIME header encountered in non-MIME message (errflg=3)' + */ + public function getImapErrors() + { + return imap_errors(); + } + /** * This function removes all of the messages flagged for deletion from the mailbox. *