simple script to read and output Mailbox body to file.

Chuck Amadi chuck at smtl.co.uk
Tue Jun 8 16:19:01 CEST 2004


Hi again I using this to test as instructed it runs on my local machine with 
my /var/spool/mail/chuck dir
thats mounted on the mail server using nfs .
Thus I still get no output only when I print mbox.

NB Im digesting formail doc's and man pages.

Cheers

Chuck

#!/usr/bin/env python
                                                                               

import email
import mailbox
                                                                               

fp =open("/var/spool/mail/chuck")
mbox = mailbox.UnixMailbox(fp)
                                                                               

for mail in mbox:
        print mail.read()
        break # Just reads one message






More information about the Python-list mailing list