public function close($expunge)
    {
        //expunge emails set to delete if delete_after_read is set
        if ($expunge) {
            \imap_close($this->inbox, CL_EXPUNGE);
        } else {
            \imap_close($this->inbox);
        }
    }