Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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()
Add Comment
Please, Sign In to add comment