Skip to content

Instantly share code, notes, and snippets.

@arfon
Created April 4, 2013 12:10
Show Gist options
  • Save arfon/5309857 to your computer and use it in GitHub Desktop.
Save arfon/5309857 to your computer and use it in GitHub Desktop.
GMail labels
require 'gmail'
label = 'MY LABLE'
gmail = Gmail.connect('USERNAME', 'PASSWORD')
gmail.mailbox(label).emails.each do |email|
mailbox = email.sender.first.mailbox
host = email.sender.first.host
puts "#{mailbox}@#{host}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment