Method: Net::IMAP#sort

Defined in:
lib/net/imap.rb

#sort(sort_keys, search_keys, charset) ⇒ Object

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.



760
761
762
# File 'lib/net/imap.rb', line 760

def sort(sort_keys, search_keys, charset)
  return sort_internal("SORT", sort_keys, search_keys, charset)
end