diff options
author | tkikuchi <> | 2004-11-16 00:16:44 +0000 |
---|---|---|
committer | tkikuchi <> | 2004-11-16 00:16:44 +0000 |
commit | c8c9975858dca76cf824605900995f75bf0b9120 (patch) | |
tree | 84da493a4b729889b6cefa356f399d8f5e07e364 | |
parent | c32165fde56caa26ec2f9138951479705313d474 (diff) | |
download | mailman2-c8c9975858dca76cf824605900995f75bf0b9120.tar.gz mailman2-c8c9975858dca76cf824605900995f75bf0b9120.tar.xz mailman2-c8c9975858dca76cf824605900995f75bf0b9120.zip |
Obscure email address in text format archive.
-rw-r--r-- | Mailman/Archiver/HyperArch.py | 10 |
1 files changed, 9 insertions, 1 deletions
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) |