summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Replybot.py
diff options
context:
space:
mode:
authorbwarsaw2000-08-02 02:50:21 +0000
committerbwarsaw2000-08-02 02:50:21 +0000
commit8b640b6045de24bdb7e84fc6edbb444e12233c66 (patch)
treeb1b6845635e760c0df33a97f10ce1f619827eb50 /Mailman/Handlers/Replybot.py
parent2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e (diff)
downloadmailman-8b640b6045de24bdb7e84fc6edbb444e12233c66.tar.gz
mailman-8b640b6045de24bdb7e84fc6edbb444e12233c66.tar.zst
mailman-8b640b6045de24bdb7e84fc6edbb444e12233c66.zip
process(): Local patch for SF bug# 109220; if the autoresponse text
has a colon in the first line, prepend a blank line so that rfc822.Message doesn't get confused about headers vs. body.
Diffstat (limited to '')
-rw-r--r--Mailman/Handlers/Replybot.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/Handlers/Replybot.py b/Mailman/Handlers/Replybot.py
index 732a80828..df194e52e 100644
--- a/Mailman/Handlers/Replybot.py
+++ b/Mailman/Handlers/Replybot.py
@@ -76,8 +76,17 @@ def process(mlist, msg, msgdata):
text = mlist.autoresponse_request_text % d
else:
text = mlist.autoresponse_postings_text % d
+ #
+ # If the autoresponse text contains a colon in its first line, the headers
+ # and body will be mixed up. The fix is to include a blank delimiting
+ # line at the front of the wrapped text.
+ text = Utils.wrap(text)
+ lines = string.split(text, '\n')
+ if string.find(lines[0], ':') >= 0:
+ lines.insert(0, '')
+ text = string.join(lines, '\n')
outmsg = Message.UserNotification(sender, mlist.GetAdminEmail(),
- subject, Utils.wrap(text))
+ subject, text)
outmsg['X-Mailer'] = 'The Mailman Replybot '
# prevent recursions and mail loops!
outmsg['X-Ack'] = 'No'