Update of /cvsroot/mailman/mailman/Mailman/Archiver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4596

Modified Files:
      Tag: Release_2_1-maint
        HyperArch.py 
Log Message:
Obscure email address in text format archive.


Index: HyperArch.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Archiver/HyperArch.py,v
retrieving revision 2.37.2.8
retrieving revision 2.37.2.9
diff -u -d -r2.37.2.8 -r2.37.2.9
--- HyperArch.py        10 Oct 2004 13:22:25 -0000      2.37.2.8
+++ HyperArch.py        16 Nov 2004 00:16:44 -0000      2.37.2.9
@@ -542,7 +542,15 @@
         body = EMPTYSTRING.join(self.body)
         if isinstance(body, types.UnicodeType):
             body = body.encode(Utils.GetCharSet(self._lang), 'replace')
-        return NL.join(headers) % d + '\n\n' + body
+        if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
+            otrans = i18n.get_translation()
+            try:
+                i18n.set_language(self._lang)
+                body = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
+                              '\g<1>' + _(' at ') + '\g<2>', body)
+            finally:
+                i18n.set_translation(otrans)
+        return NL.join(headers) % d + '\n\n' + body + '\n'
 
     def _set_date(self, message):
         self.__super_set_date(message)

_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to