From c8c9975858dca76cf824605900995f75bf0b9120 Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Tue, 16 Nov 2004 00:16:44 +0000 Subject: Obscure email address in text format archive. --- Mailman/Archiver/HyperArch.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Mailman/Archiver/HyperArch.py') diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py index ca597c72..28db83ee 100644 --- a/Mailman/Archiver/HyperArch.py +++ b/Mailman/Archiver/HyperArch.py @@ -542,7 +542,15 @@ class Article(pipermail.Article): 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) -- cgit v1.2.3