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
This commit is contained in:
2019-12-09 14:33:04 +00:00
parent 366e095e20
commit 72465269a3

View File

@@ -472,7 +472,7 @@ class imap
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno)."\n". $content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno)."\n".
@imap_body (self::$instance[$this->mailbox], $msgno); @imap_body (self::$instance[$this->mailbox], $msgno);
$errors = imap_errors (); $errors = imap_errors ();
if ($errors !== false) if ($errors !== false || $content === "\n")
throw new \Exception ("Mail not found", 404); throw new \Exception ("Mail not found", 404);
return $content; return $content;
} }
@@ -489,7 +489,7 @@ class imap
imap_errors(); imap_errors();
$content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno); $content = @imap_fetchheader (self::$instance[$this->mailbox], $msgno);
$errors = imap_errors (); $errors = imap_errors ();
if ($errors !== false) if ($errors !== false || $content === "")
throw new \Exception ("Mail not found", 404); throw new \Exception ("Mail not found", 404);
return $content; return $content;
} }
@@ -506,7 +506,7 @@ class imap
imap_errors(); imap_errors();
$content = @imap_body (self::$instance[$this->mailbox], $msgno); $content = @imap_body (self::$instance[$this->mailbox], $msgno);
$errors = imap_errors (); $errors = imap_errors ();
if ($errors !== false) if ($errors !== false || $content === "")
throw new \Exception ("Mail not found", 404); throw new \Exception ("Mail not found", 404);
return $content; return $content;
} }