Guest User

Untitled

a guest
Mar 4th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. require 'net/imap'
  2.  
  3. ADMIN_USER = 'blah'
  4. ADMIN_PASS = 'blahpass'
  5. IMAP_HOST = 'imap.domain.org'
  6.  
  7. username = ARGV.first
  8.  
  9. Net::IMAP.debug = 10
  10. imap = Net::IMAP.new(IMAP_HOST)
  11.  
  12. imap.authenticate('LOGIN', "#{username}*#{ADMIN_USER}", ADMIN_PASS)
  13. imap.list("", "*").map {|m| m.name }.each do |mailbox|
  14. imap.select(mailbox)
  15. imap.expunge
  16. end
Add Comment
Please, Sign In to add comment