Skip to content

Instantly share code, notes, and snippets.

@Nokogiri
Created February 20, 2010 21:18
Show Gist options
  • Save Nokogiri/309919 to your computer and use it in GitHub Desktop.
Save Nokogiri/309919 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'net/imap'
user = 'nokogiri@user-helfen-usern.de'
pass = 'SUPERSECRETPASSWORD'
folder = ['INBOX','1und1']
box = Net::IMAP.new('uhuc.de','993',true)
box.authenticate('LOGIN', user, pass)
folder.each do |dir|
box.examine(dir)
new = box.search(['RECENT']).count
old = box.search(['NOT','NEW']).count
puts "#{dir} \t#{new}/#{old}"
end
box.logout()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment