Skip to content

Instantly share code, notes, and snippets.

@boogah
Created March 29, 2010 18:52
Show Gist options
  • Save boogah/348238 to your computer and use it in GitHub Desktop.
Save boogah/348238 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'net/imap'
server = 'imap.mail.com'
username = 'YOUR USERNAME'
password = 'YOUR PASSWORD'
folder = 'INBOX'
imap = Net::IMAP.new(server, 993, true)
imap.login(user, password)
imap.select(folder)
imap.search(["NOT", "SEEN"]).each do |message_id|
imap.store(message_id, "+FLAGS", [:Seen])
end
imap.logout()
imap.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment