I'm trying to implement something like gmail conversational view and the way I've designed it is that I store "subject" of the mail + other parties email address (in case you send, other party is recipient, and in case of receiving, sender is the other party).
What I do is, I store these data in a file using a dictionary and cPickle, and the key is as I explained above, "subject + other party". But I believe this key is not efficient enough as I need to do search of the email address of the party in the key.
Is there any suggestion how I could approach this and what the proper data structure for storing list of addresses and subject is??