Method: Net::IMAP#select

Defined in:
lib/net/imap.rb

#select(mailbox) ⇒ Object

Sends a SELECT command to select a mailbox so that messages in the mailbox can be accessed.

After you have selected a mailbox, you may retrieve the number of items in that mailbox from @responses[-1], and the number of recent messages from @responses[-1]. Note that these values can change if new messages arrive during a session; see #add_response_handler() for a way of detecting this event.

A Net::IMAP::NoResponseError is raised if the mailbox does not exist or is for some reason non-selectable.



450
451
452
453
454
455
# File 'lib/net/imap.rb', line 450

def select(mailbox)
  synchronize do
    @responses.clear
    send_command("SELECT", mailbox)
  end
end