rename

rename(mailbox, newname) Instance Public methods Sends a RENAME command to change the name of the mailbox to newname. A Net::IMAP::NoResponseError is raised if a mailbox with the name mailbox cannot be renamed to newname for whatever reason; for instance, because mailbox does not exist, or because there is already a mailbox with the name newname.

search

search(keys, charset = nil) Instance Public methods Sends a SEARCH command to search the mailbox for messages that match the given searching criteria, and returns message sequence numbers. keys can either be a string holding the entire search string, or a single-dimension array of search keywords and arguments. The following are some common search criteria; see [IMAP] section 6.4.4 for a full list. <message set> a set of message sequence numbers. ',' indicates an interva

select

select(mailbox) Instance Public methods 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

setacl

setacl(mailbox, user, rights) Instance Public methods Sends the SETACL command along with mailbox, user and the rights that user is to have on that mailbox. If rights is nil, then that user will be stripped of any rights to that mailbox. The IMAP ACL commands are described in [RFC-2086].

setquota

setquota(mailbox, quota) Instance Public methods Sends a SETQUOTA command along with the specified mailbox and quota. If quota is nil, then quota will be unset for that mailbox. Typically one needs to be logged in as server admin for this to work. The IMAP quota commands are described in [RFC-2087].

sort

sort(sort_keys, search_keys, charset) Instance Public methods Sends a SORT command to sort messages in the mailbox. Returns an array of message sequence numbers. For example: p imap.sort(["FROM"], ["ALL"], "US-ASCII") #=> [1, 2, 3, 5, 6, 7, 8, 4, 9] p imap.sort(["DATE"], ["SUBJECT", "hello"], "US-ASCII") #=> [6, 7, 8, 1] See [SORT-THREAD-EXT] for more details.

starttls

starttls(options = {}, verify = true) Instance Public methods Sends a STARTTLS command to start TLS session.

status

status(mailbox, attr) Instance Public methods Sends a STATUS command, and returns the status of the indicated mailbox. attr is a list of one or more attributes that we are request the status of. Supported attributes include: MESSAGES:: the number of messages in the mailbox. RECENT:: the number of recent messages in the mailbox. UNSEEN:: the number of unseen messages in the mailbox. The return value is a hash of attributes. For example: p imap.status("inbox", ["MESSAGES", "RECENT"]

store

store(set, attr, flags) Instance Public methods Sends a STORE command to alter data associated with messages in the mailbox, in particular their flags. The set parameter is a number or an array of numbers or a Range object. Each number is a message sequence number. attr is the name of a data item to store: 'FLAGS' means to replace the message's flag list with the provided one; '+FLAGS' means to add the provided flags; and '-FLAGS' means to remove them. flags is a list of flags. T

subscribe

subscribe(mailbox) Instance Public methods Sends a SUBSCRIBE command to add the specified mailbox name to the server's set of âactiveâ or âsubscribedâ mailboxes as returned by lsub(). A Net::IMAP::NoResponseError is raised if mailbox cannot be subscribed to, for instance because it does not exist.