riccardo_cut-me at cut.me.sideralis.net
Sat Mar 20 19:35:15 CET 2004
On Sat, 20 Mar 2004 00:29:40 -0800, Michele Simionato wrote:
> I use Mozilla or Netscape, so my emails are stored in the nsmail
> or the Mozilla's equivalent. What's the simplest way to look at them
> extract the mails with a given subject? In principle I could use a
> regular expression, but I bet there are better solutions already
> Second question: are Mozilla and Netscape compatible, i.e. are the
> emails stored with the same format and can I use the same extraction
> method on both?
> Michele Simionato
maybe you could use something like that
"""code not tested"""
mbox = mailbox.UnixMailbox(fp, email.message_from_file)
for msg in mbox.next():
if msg['Subject']=="the subject you're searching for":
for msg in msg_list:
Dunno about Mozilla/Netscape compatibility, but I think they'll use the
same mail format.
~@. ideralis Programs
More information about the Python-list