diff options
Diffstat (limited to 'Mailman/Mailbox.py')
| -rw-r--r-- | Mailman/Mailbox.py | 16 |
1 files changed, 16 insertions, 0 deletions
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) + |
