Method: IMAPClient#find_mailboxes
- Defined in:
- lib/imap_client.rb
#find_mailboxes ⇒ Object
Finds mailboxes with messages that were selected by the :Boxes option.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/imap_client.rb', line 281 def find_mailboxes mailboxes = @imap.list(@root, "*") if mailboxes.nil? then log "Found no mailboxes, you may have an incorrect root" return [] end mailboxes.reject! { |mailbox| mailbox.attr.include? :Noselect } mailboxes.map! { |mailbox| mailbox.name } mailboxes.reject! { |mailbox| mailbox !~ @box_re } mailboxes = mailboxes.sort_by { |m| m.downcase } log "Found #{mailboxes.length} mailboxes to search:" mailboxes.each { |mailbox| log "\t#{mailbox}" } if @verbose return mailboxes end |