Ready to get started with anonymous questions today? It's easy! Learn more.
def msgfactory(self, fp): try: return email.message_from_file(fp) except email.errors.MessageParseError: # Don't return None since that will # stop the mailbox iterator return '' def mailstats(self, user): if os.path.isfile('/var/spool/mail/'+user): fp=open('/var/spool/mail/'+user) else: print 'I cannot open mail for user',user sys.exit(1) str = self.msgfactory(fp) mbox = mailbox.UnixMailbox(fp, str) ..................
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.