method
add_response_handler
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
add_response_handler(handler = Proc.new)
public
Adds a response handler. For example, to detect when the server sends a new EXISTS response (which normally indicates new messages being added to the mailbox), add the following handler after selecting the mailbox:
imap.add_response_handler { |resp| if resp.kind_of?(Net::IMAP::UntaggedResponse) and resp.name == "EXISTS" puts "Mailbox now has #{resp.data} messages" end }