diff --git a/src/Storage/Mbox.php b/src/Storage/Mbox.php index 30de89cd..8ae352ac 100644 --- a/src/Storage/Mbox.php +++ b/src/Storage/Mbox.php @@ -216,8 +216,8 @@ public function __construct($params) */ protected function isMboxFile($file, $fileIsString = true) { + ErrorHandler::start(E_NOTICE); if ($fileIsString) { - ErrorHandler::start(E_WARNING); $file = fopen($file, 'r'); ErrorHandler::stop(); if (! $file) { @@ -230,15 +230,15 @@ protected function isMboxFile($file, $fileIsString = true) $result = false; $line = fgets($file) ?: ''; + if (strpos($line, 'From ') === 0) { $result = true; } if ($fileIsString) { - ErrorHandler::start(E_WARNING); fclose($file); - ErrorHandler::stop(); } + ErrorHandler::stop(); return $result; }