Last active
February 9, 2016 22:05
-
-
Save sc68cal/9d42a8a364661bb41fb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: | |
# $ python Desktop/mail_agents.py ~/mail/neutron | sort | uniq | |
import mailbox | |
import sys | |
mailbox = mailbox.Maildir(sys.argv[1]) | |
for email in mailbox: | |
try: | |
agent = email['User-Agent'] | |
print agent.replace('\n', '') | |
except KeyError: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment