Method: IMAPProcessor::Client#run
- Defined in:
- lib/imap_processor/client.rb
#run(message, flags) ⇒ Object
Selects messages from mailboxes then marking them with flags. If a
block is given it is run after message marking.
Unless :Noop was set, then it just prints out what it would do.
Automatically called by IMAPClient::run
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/imap_processor/client.rb', line 51 def run(, flags) log = 0 mailboxes = find_mailboxes mailboxes.each do |mailbox| @mailbox = mailbox @imap.select @mailbox log "Selected #{@mailbox}" = next if .empty? += .length unless @noop then mark , flags else log "Noop - not marking" end yield if block_given? end log "Done. Found #{} messages in #{mailboxes.length} mailboxes" end |