From 719470062053861ab56f9c23af0013bf02ed80bb Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 28 Feb 2002 22:53:53 +0000 Subject: 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. --- Mailman/MailList.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Mailman/MailList.py') 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) -- cgit v1.2.3-70-g09d2