Adds a response handler. For example, to detect when the server sends us a
new EXISTS response (which normally
indicates new messages being added
to the mail box), you could add the following handler after selecting the
mailbox.

imap.add_response_handler{|resp|ifresp.kind_of?(Net::IMAP::UntaggedResponse)andresp.name=="EXISTS"puts"Mailbox now has #{resp.data} messages"end}