public static function retrieve($id) { $box = self::getInstance(); $id = intval($id); if (!isset($box->indexes[$id])) { return null; } fseek($box->storage, $box->indexes[$id]['offset']); if (($mail = @fread($box->storage, $box->indexes[$id]['length'])) === false) { return false; } return MailMessage::parse($mail); }