""" Matthew Russell - 29 Oct 06 This script parses the current user's "Envelope Index" cache file located at ~/Library/Mail/Envelope Index and displays in csv format the e-mail addresses and names of individuals in the cache file. Having this information on hand is especially useful if you've come to rely on Mail's ability to auto-complete information which you may not have stored away in your Address Book. Another great tool to use to explore Envelope Index and other cache files is the SQLite Database Browser. You can get pysqlite from http://initd.org/tracker/pysqlite You can get the SQLite Database Browser from http://sourceforge.net/projects/sqlitebrowser/ """ from pysqlite2 import dbapi2 as sqlite from os import getlogin conn = sqlite.connect("/Users/%s/Library/Mail/Envelope Index" % (getlogin(),)) cursor = conn.cursor() cursor.execute("select address, comment from addresses") results = cursor.fetchall() print "email,name" for i in results: print "%s,%s" % (i[0],i[1],)