From 46d178b98b5ae3c6b164258bdba01b9598cc73dc Mon Sep 17 00:00:00 2001 From: mailman Date: Fri, 27 Feb 1998 16:10:31 +0000 Subject: Initial revision --- Mailman/Mailbox.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Mailman/Mailbox.py (limited to 'Mailman/Mailbox.py') diff --git a/Mailman/Mailbox.py b/Mailman/Mailbox.py new file mode 100644 index 000000000..503ad9e15 --- /dev/null +++ b/Mailman/Mailbox.py @@ -0,0 +1,16 @@ +import mailbox + +class Mailbox(mailbox.UnixMailbox): + # msg should be an rfc822 message or a subclass. + def AppendMessage(self, msg): + # seek to the last char of the mailbox + self.fp.seek(1,2) + if self.fp.read(1) <> '\n': + self.fp.write('\n') + self.fp.write(msg.unixfrom) + for line in msg.headers: + self.fp.write(line) + if msg.body[0] <> '\n': + self.fp.write('\n') + self.fp.write(msg.body) + -- cgit v1.2.3-70-g09d2