summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-02-28 23:36:28 +0000
committerbwarsaw2002-02-28 23:36:28 +0000
commit84ffced74912ffcdc882e0da66c3b2b879df02f4 (patch)
tree42f09e01abf65a53060df16c72f75aa0f9210105
parent719470062053861ab56f9c23af0013bf02ed80bb (diff)
downloadmailman-84ffced74912ffcdc882e0da66c3b2b879df02f4.tar.gz
mailman-84ffced74912ffcdc882e0da66c3b2b879df02f4.tar.zst
mailman-84ffced74912ffcdc882e0da66c3b2b879df02f4.zip
__sendAdminBounceNotice(): Because the UserNotification constructor
already sets the Content-Type: and MIME-Version: headers, don't do it explicitly (it'll add multiple headers). Instead just call set_type() to set the type to multipart/mixed. (Must do that before attempting to attach.) sendNextNotification(): Because we do not want the Subject: to be encoded, don't pass the subject into the UserNotification constructor. See MailList.ChangeMemberAddress() for details.
-rw-r--r--Mailman/Bouncer.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py
index f65d33c6c..1802d53af 100644
--- a/Mailman/Bouncer.py
+++ b/Mailman/Bouncer.py
@@ -167,13 +167,14 @@ class Bouncer:
umsg = Message.UserNotification(self.GetOwnerEmail(),
siteowner, subject,
lang=self.preferred_language)
+ # BAW: Be sure you set the type before trying to attach, or you'll get
+ # a MultipartConversionError.
+ umsg.set_type('multipart/mixed')
umsg.attach(MIMEText(text))
if isinstance(msg, StringType):
umsg.attach(MIMEText(msg))
else:
umsg.attach(MIMEMessage(msg))
- umsg['Content-Type'] = 'multipart/mixed'
- umsg['MIME-Version'] = '1.0'
umsg.send(self)
def sendNextNotification(self, member):
@@ -194,7 +195,6 @@ class Bouncer:
confirmurl = '%s/%s' % (self.GetScriptURL('confirm', absolute=1),
info.cookie)
optionsurl = self.GetOptionsURL(member, absolute=1)
- subject = 'confirm ' + info.cookie
reqaddr = self.GetRequestEmail()
lang = self.getMemberLanguage(member)
text = Utils.maketext(
@@ -206,7 +206,11 @@ class Bouncer:
'password' : self.getMemberPassword(member),
'owneraddr' : self.GetOwnerEmail(),
}, lang=lang, mlist=self)
- msg = Message.UserNotification(member, reqaddr, subject, text, lang)
+ msg = Message.UserNotification(member, reqaddr, text=text, lang=lang)
+ # BAW: See the comment in MailList.py ChangeMemberAddress() for why we
+ # set the Subject this way.
+ del msg['subject']
+ msg['Subject'] = 'confirm ' + info.cookie
msg.send(self)
info.noticesleft -= 1
info.lastnotice = time.localtime()[:3]