diff options
| author | bwarsaw | 2003-04-17 04:37:23 +0000 |
|---|---|---|
| committer | bwarsaw | 2003-04-17 04:37:23 +0000 |
| commit | 8e3a0f8f5bd944b91218a214c6003497223cdbed (patch) | |
| tree | 99618858b437ff27bf2c8e051786da98cdc1fd1c /Mailman/Mailbox.py | |
| parent | b92fdfa32e8634d4df59e53bab84b0ebdf4bc2a4 (diff) | |
| download | mailman-8e3a0f8f5bd944b91218a214c6003497223cdbed.tar.gz mailman-8e3a0f8f5bd944b91218a214c6003497223cdbed.tar.zst mailman-8e3a0f8f5bd944b91218a214c6003497223cdbed.zip | |
Diffstat (limited to 'Mailman/Mailbox.py')
| -rw-r--r-- | Mailman/Mailbox.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Mailman/Mailbox.py b/Mailman/Mailbox.py index 8ab085cca..a31d27295 100644 --- a/Mailman/Mailbox.py +++ b/Mailman/Mailbox.py @@ -1,17 +1,17 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software +# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """Extend mailbox.UnixMailbox. @@ -28,6 +28,13 @@ from email.Errors import MessageParseError from Mailman import mm_cfg from Mailman.Message import Message +try: + True, False +except NameError: + True = 1 + False = 0 + + def _safeparser(fp): try: @@ -44,8 +51,8 @@ class Mailbox(mailbox.PortableUnixMailbox): # msg should be an rfc822 message or a subclass. def AppendMessage(self, msg): - # Check the last character of the file and write a newline if it isn't - # a newline (but not at the beginning of an empty file). + # Check the last character of the file and write a newline if it isn't + # a newline (but not at the beginning of an empty file). try: self.fp.seek(-1, 2) except IOError, e: @@ -59,7 +66,10 @@ class Mailbox(mailbox.PortableUnixMailbox): self.fp.seek(1, 2) # Create a Generator instance to write the message to the file g = Generator(self.fp) - g(msg, unixfrom=1) + g.flatten(msg, unixfrom=True) + # Add one more trailing newline for separation with the next message + # to be appended to the mbox. + print >> self.fp |
