function move($uid, $folder, $expunge = true)
    {
        if ( $this->stream !== null && $this->stream !== false ) {

            $tries = 0;

            while ( $tries++ < 3 ) {
                if ( imap_mail_move($this->stream, $uid, $folder, CP_UID) ) {
                    if ( $expunge ) {
                        imap_expunge($this->stream);
                    }
                    return true;
                } else {
                    sleep(1);
                }
            }

        }

        return false;
    }