mailbox module broken!

Stuart D. Gathman stuart at bmsi.com
Thu Oct 3 13:36:47 EDT 2002


The following trivial code to read through a unix mailbox skips a little
over 100 messages in the mailbox at 

http://www.bmsi.com/python/test/inbox

I have tested python-2.1.3 and python2-2.2.1

import mailbox

f = open('inbox','r')
mbox = mailbox.UnixMailbox(f)
while 1:
  msg = mbox.next()
  if msg == None: break
  subj = msg.getheader('subject')
  print subj,msg.getheader('date')


Programs such as pine and mozilla, and imap have no trouble reading the
mailbox.  Looking at the mailbox with vi, I can see no reason why it
shouldn't work.  The last message seen by 'mailbox' is 

abc0004 backup Tue, 1 Oct 2002 02:50:04 -0400

This is *not* the last message in the mailbox.

What is going on?

-- 
	      Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.



More information about the Python-list mailing list