protected function _isMboxFile($file, $fileIsString = true)
    {
        if ($fileIsString) {
            $file = @fopen($file, 'r');
            if (!$file) {
                return false;
            }
        } else {
            fseek($file, 0);
        }

        $result = false;

        $line = fgets($file);
        if (strpos($line, 'From ') === 0) {
            $result = true;
        }

        if ($fileIsString) {
            @fclose($file);
        }

        return $result;
    }
protected function _isMboxFile($file, $fileIsString = true)
    {
        if ($fileIsString) {
            $file = @fopen($file, 'r');
            if (!$file) {
                return false;
            }
        } else {
            fseek($file, 0);
        }

        $result = false;

        $line = fgets($file);
        if (strpos($line, 'From ') === 0) {
            $result = true;
        }

        if ($fileIsString) {
            @fclose($file);
        }

        return $result;
    }
protected function _isMboxFile ( $ file , $ fileIsString = true ) { if ( $ fileIsString ) { $ file = @ fopen ( $ file , 'r' ) ; if ( ! $ file ) { return false ; } } else { fseek ( $ file , 0 ) ; } $ result = false ; $ line = fgets ( $ file ) ; if ( strpos ( $ line , 'From ' ) === 0 ) { $ result = true ; } if ( $ fileIsString ) { @ fclose ( $ file ) ; } return $ result ; }
check if given file is a mbox file

if $file is a resource its file pointer is moved after the first line

@param  resource|string $file stream resource of name of file
@param  bool $fileIsString file is string or resource
@return bool file is mbox file
check if given file is a mbox file