add_response_handler(handler = Proc.new)
Instance Public methods
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.
1 2 3 4 5 | imap.add_response_handler { |resp| if resp.kind_of?(Net:: IMAP ::UntaggedResponse) and resp.name == "EXISTS" puts "Mailbox now has #{resp.data} messages" end } |
Please login to continue.