Let's use the UnixMailbox class instead of PortableUnixMailbox to read

mbox messages. PortableUnixMailbox gets confused with messages that have
'From ' in the message body unquoted.
This commit is contained in:
Paul Rodger 2002-04-20 11:52:51 +00:00
parent 1bd93b6d08
commit e07cdd7a2b
1 changed files with 4 additions and 4 deletions

View File

@ -219,9 +219,9 @@ class Options:
user_error("argument to -d must be less than 10000")
class Mbox(mailbox.PortableUnixMailbox):
class Mbox(mailbox.UnixMailbox):
"""Class that allows read/write access to a 'mbox' mailbox.
Subclasses the mailbox.PortableUnixMailbox class.
Subclasses the mailbox.UnixMailbox class.
"""
mbox_file = None # file handle for the mbox file
mbox_file_name = None # GzipFile class has no .name variable
@ -233,7 +233,7 @@ class Mbox(mailbox.PortableUnixMailbox):
def __init__(self, path, mode="r"):
"""Constructor for opening an existing 'mbox' mailbox.
Extends constructor for mailbox.PortableUnixMailbox()
Extends constructor for mailbox.UnixMailbox()
Named Arguments:
path -- file name of the 'mbox' file to be opened
@ -250,7 +250,7 @@ class Mbox(mailbox.PortableUnixMailbox):
except IOError, msg:
unexpected_error(msg)
self.mbox_file_name = path
mailbox.PortableUnixMailbox.__init__(self, self.mbox_file)
mailbox.UnixMailbox.__init__(self, self.mbox_file)
def write(self, msg):
"""Write a rfc822 message object to the 'mbox' mailbox.