diff options
| author | bwarsaw | 2000-08-02 02:00:13 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-08-02 02:00:13 +0000 |
| commit | 49d25075a85e6173a991346782008486096c07e6 (patch) | |
| tree | 309934ebfb0a26909b15a6ef8dae6816310bc107 /Mailman/Message.py | |
| parent | f8f70afab898a956cc5a807cd21e1ae4af8e4742 (diff) | |
| download | mailman-49d25075a85e6173a991346782008486096c07e6.tar.gz mailman-49d25075a85e6173a991346782008486096c07e6.tar.zst mailman-49d25075a85e6173a991346782008486096c07e6.zip | |
Diffstat (limited to 'Mailman/Message.py')
| -rw-r--r-- | Mailman/Message.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/Mailman/Message.py b/Mailman/Message.py index c973d8859..496144fa2 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -188,18 +188,10 @@ class Message(rfc822.Message): class OutgoingMessage(Message): def __init__(self, text=''): from Mailman.pythonlib.StringIO import StringIO - # Because of semantics imposed by rfc822.Message, text cannot have a - # colon on the first line because otherwise the Message class - # constructor will think the first line is an rfc822 header. This can - # severely mess up the message. If you want to set headers on this - # object, just the __setitem__ interface (i.e. msg['to']='somebody'. - # - # If text has a colon on the first line, the best thing to do is to - # prepend a blank line. - lines = string.split(text, '\n') - if string.count(lines[0], ':'): - lines.insert(0, '\n') - Message.__init__(self, StringIO(string.join(lines, '\n'))) + # NOTE: text if supplied must begin with valid rfc822 headers. It can + # also begin with the body of the message but in that case you better + # make sure that the first line does NOT contain a colon! + Message.__init__(self, StringIO(text)) |
