daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Sep 4th, 2018 243 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imap folder only returning a subset of emails with it
  2. username = ask("Enter your username:  ") { |q| q.echo = true }
  3. password = ask("Enter your password:  ") { |q| q.echo = "*" }
  4. look_in_folder = "[Gmail]/Sent Mail"
  5. save_to_folder = "/Users/penang/Desktop"
  6.  
  7. puts 'Starting...'
  8. imap = Net::IMAP.new('imap.gmail.com', '993', true)
  9.  
  10. puts "Logging in as #{username} ..."
  11.  
  12. imap.login(username, password)
  13.  
  14. imap.examine(look_in_folder)
  15.  
  16. mails = imap.uid_search(["FROM", "me"])
  17. puts "Found #{mails.count} mail(s) in folder '#{look_in_folder}'"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top