summaryrefslogtreecommitdiff
path: root/Mailman/MailList.py
diff options
context:
space:
mode:
authorbwarsaw2002-02-28 22:53:53 +0000
committerbwarsaw2002-02-28 22:53:53 +0000
commit719470062053861ab56f9c23af0013bf02ed80bb (patch)
tree1fbaddada57340ac032803ca8955397a7625dc41 /Mailman/MailList.py
parent91a424d74d70a42b1a3649a319d4a9a740346bdf (diff)
downloadmailman-719470062053861ab56f9c23af0013bf02ed80bb.tar.gz
mailman-719470062053861ab56f9c23af0013bf02ed80bb.tar.zst
mailman-719470062053861ab56f9c23af0013bf02ed80bb.zip
ChangeMemberAddress(): Pass the member's language into the
UserNotification constructor so that the verification message gets encoded correctly. There's one gotcha that affects all confirmation messages (and I will audit this next). From the comment: # BAW: We don't pass the Subject: into the UserNotification # constructor because it will encode it in the charset of the language # being used. For non-us-ascii charsets, this means it will probably # quopri quote it, and thus replies will also be quopri encoded. But # MailCommandHandler doesn't yet grok such headers, and I'm avoiding # fixing that until a future version which will completely rewrite the # mail command handling. So, just set the Subject: in a separate # step, although we have to delete the one UserNotification adds. Sigh.
Diffstat (limited to 'Mailman/MailList.py')
-rw-r--r--Mailman/MailList.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index a5cb36bd5..6e6b72f1a 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -872,6 +872,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin,
confirmurl = '%s/%s' % (self.GetScriptURL('confirm', absolute=1),
cookie)
realname = self.real_name
+ lang = self.getMemberLanguage(oldaddr)
text = Utils.maketext(
'verify.txt',
{'email' : newaddr,
@@ -882,11 +883,20 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin,
'remote' : '',
'listadmin' : self.GetAdminEmail(),
'confirmurl' : confirmurl,
- }, lang=self.getMemberLanguage(oldaddr), mlist=self)
+ }, lang=lang, mlist=self)
+ # BAW: We don't pass the Subject: into the UserNotification
+ # constructor because it will encode it in the charset of the language
+ # being used. For non-us-ascii charsets, this means it will probably
+ # quopri quote it, and thus replies will also be quopri encoded. But
+ # MailCommandHandler doesn't yet grok such headers, and I'm avoiding
+ # fixing that until a future version which will completely rewrite the
+ # mail command handling. So, just set the Subject: in a separate
+ # step, although we have to delete the one UserNotification adds.
msg = Message.UserNotification(
newaddr, self.GetRequestEmail(),
- 'confirm %s' % cookie,
- text)
+ text=text, lang=lang)
+ del msg['subject']
+ msg['Subject'] = 'confirm ' + cookie
msg['Reply-To'] = self.GetRequestEmail()
msg.send(self)
@@ -1034,7 +1044,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin,
msg = Message.UserNotification(
addr, self.GetRequestEmail(),
'confirm %s' % cookie,
- text)
+ text, lang)
msg['Reply-To'] = self.GetRequestEmail()
msg.send(self)