$this->_fh = @
fopen($filename, 'r'
);
if (!
$this->_fh
) { /**
* @see Zend_Mail_Storage_Exception
*/
throw new Zend_Mail_Storage_Exception('cannot open mbox file'
);
} $this->_filename =
$filename;
$this->_filemtime =
filemtime($this->_filename
);
if (!
$this->
_isMboxFile($this->_fh, false
)) { @
fclose($this->_fh
);
/**
* @see Zend_Mail_Storage_Exception
*/
throw new Zend_Mail_Storage_Exception('file is not a valid mbox format'
);
} $messagePos = array
('start' =>
ftell($this->_fh
), 'separator' => 0, 'end' => 0
);
while (($line =
fgets($this->_fh
)) !== false
) { if (strpos($line, 'From '
) === 0
) { $messagePos['end'
] =
ftell($this->_fh
) -
strlen($line) - 2; // + newline