def snarf_mailbox(imap, mailbox)
imap.select(mailbox)
count = 0
+ total_count = 0
imap.search(["NOT", "DELETED"]).each do |message_id|
data = imap.fetch(message_id, [ "UID", "RFC822.HEADER", "RFC822.TEXT" ])
a = data[0].attr
fp.write(a["RFC822.TEXT"])
fp.close
count = count + 1
+ total_count = total_count + 1
if (count > 10) then
count = 0
printf(".")
STDOUT.flush()
end
end
- puts "fetched #{count} messages from #{mailbox}"
+ puts "fetched #{total_count} messages from #{mailbox}"
end
# MAIN