Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # Example:
  2. # $ python Desktop/mail_agents.py ~/mail/neutron | sort | uniq
  3.  
  4. import mailbox
  5. import sys
  6.  
  7. mailbox = mailbox.Maildir(sys.argv[1])
  8.  
  9. for email in mailbox:
  10. try:
  11. agent = email['User-Agent']
  12. print agent.replace('\n', '')
  13. except KeyError:
  14. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement