public function openFolder($folder_path, $attempts = 3) {
        $this->checkConnection();

        if(property_exists($folder_path, 'path')) {
            $folder_path = $folder_path->path;
        }

        if ($this->active_folder !== $folder_path) {
            $this->active_folder = $folder_path;

            imap_reopen($this->getConnection(), $folder_path, $this->getOptions(), $attempts);
        }
    }