From 72465269a36ebd354f5f893754d8efe3955fabe1 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 9 Dec 2019 14:33:04 +0000 Subject: [PATCH] imap : if the content is empty, the mail is not found git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5824 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- imap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imap.php b/imap.php index d94b333..f8e3008 100644 --- a/imap.php +++ b/imap.php @@ -472,7 +472,7 @@ class imap $content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno)."\n". @imap_body (self::$instance[$this->mailbox], $msgno); $errors = imap_errors (); - if ($errors !== false) + if ($errors !== false || $content === "\n") throw new \Exception ("Mail not found", 404); return $content; } @@ -489,7 +489,7 @@ class imap imap_errors(); $content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno); $errors = imap_errors (); - if ($errors !== false) + if ($errors !== false || $content === "") throw new \Exception ("Mail not found", 404); return $content; } @@ -506,7 +506,7 @@ class imap imap_errors(); $content = @imap_body (self::$instance[$this->mailbox], $msgno); $errors = imap_errors (); - if ($errors !== false) + if ($errors !== false || $content === "") throw new \Exception ("Mail not found", 404); return $content; }