We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d629660 + 59358b3 commit 20bc36cCopy full SHA for 20bc36c
lib/mail/network/retriever_methods/imap.rb
@@ -75,7 +75,10 @@ def find(options=nil, &block)
75
76
start do |imap|
77
options[:read_only] ? imap.examine(options[:mailbox]) : imap.select(options[:mailbox])
78
+
79
uids = imap.uid_search(options[:keys], options[:search_charset])
80
+ .to_a # older net-imap may return nil, newer may return ESearchResult struct
81
+ .sort # RFC3501 does _not_ require UIDs to be returned in order
82
uids.reverse! if options[:what].to_sym == :last
83
uids = uids.first(options[:count]) if options[:count].is_a?(Integer)
84
uids.reverse! if (options[:what].to_sym == :last && options[:order].to_sym == :asc) ||
0 commit comments