[Mailman-Developers] Content-Type headers

Mikhail Sobolev mikhail.sobolev@transas.com
Fri, 7 Sep 2001 10:42:10 +0100


--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

While checking the maillist server answers, I found that those messages
do not have any Content-Type headers...  Which seems to be rather wrong.
For example, in Russian we use a number of character sets among which
koi8-r and cp1251 are the most common.  That means that most likely the
translation for Russian will be in either of them.  Therefor, the lack
of Content-Type header leads to the problems on the receiving side,
where the default character set is different from the one used for
translation.

Here is a small patch, which, hopefully, fixes the problem.

--
Misha

--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ml.patch"

Index: MailList.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v
retrieving revision 2.38
diff -u -b -r2.38 MailList.py
--- MailList.py	2001/09/05 02:39:28	2.38
+++ MailList.py	2001/09/07 09:41:05
@@ -630,6 +630,8 @@
                 'confirm %s' % cookie,
                 text)
             msg['Reply-To'] = self.GetRequestEmail()
+            msg.addheader('Content-Type', 'text/plain', charset=Utils.GetCharSet(lang))
+
             msg.send(self)
             if recipient <> email:
                 who = "%s (%s)" % (email, recipient.split('@')[0])
@@ -714,6 +716,8 @@
             msg = Message.UserNotification(
                 self.owner, Utils.get_site_email(self.host_name, '-admin'),
                 subject, text)
+            msg.addheader('Content-Type', 'text/plain', charset=Utils.GetCharSet(lang))
+
             msg.send(self)
 
     def ApprovedDeleteMember(self, name, whence=None,
@@ -742,6 +746,8 @@
             msg = Message.UserNotification(
                 self.owner, Utils.get_site_email(self.host_name, '-admin'),
                 subject, text)
+            msg.addheader('Content-Type', 'text/plain', charset=Utils.GetCharSet(self.preferred_language))
+
             msg.send(self)
         if whence:
             whence = "; %s" % whence
@@ -807,6 +813,8 @@
             'confirm %s' % cookie,
             text)
         msg['Reply-To'] = self.GetRequestEmail()
+        msg.addheader('Content-Type', 'text/plain', charset=Utils.GetCharSet(lang))
+
         msg.send(self)
 
     def ApprovedChangeMemberAddress(self, oldaddr, newaddr, globally):
@@ -900,6 +908,8 @@
             'confirm %s' % cookie,
             text)
         msg['Reply-To'] = self.GetRequestEmail()
+        msg.addheader('Content-Type', 'text/plain', charset=Utils.GetCharSet(lang))
+
         msg.send(self)
 
 

--EeQfGwPcQSOJBaQU--