simple script to read and output Mailbox body to file.

Chuck Amadi chuck at smtl.co.uk
Wed Jun 9 10:26:31 CEST 2004


Hi After createing a mailbox using packf 
packf +/home/chuck/testwwws all -file testbox and thus cp 3 5 6 (emails) .

I get output with this except only one email header and body message , the 
commented out stuff , does that iterate or can it produce all current 3 email 
body messages. Cheers Im nearly there.

for mail in mbox:
#       body = mail.get_payload()
#       bodies.append(body)
#       msg = mail.message_from_file(mail)
        print 'mail'
        print mail['Subject']
        print mail.get_content_type()#text/plain
        print mail.get_payload()
        break # just look at one message






More information about the Python-list mailing list