aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortkikuchi <>2005-10-31 04:39:25 +0000
committertkikuchi <>2005-10-31 04:39:25 +0000
commita68aa926bb30d46adb47fa6efc3b20b4012eaac4 (patch)
tree506dac2042d7be31cae35f5151dd28c2d5c221fa
parent592a4abe4b6229e37956560ee7240cc7a9ce444d (diff)
downloadmailman2-a68aa926bb30d46adb47fa6efc3b20b4012eaac4.tar.gz
mailman2-a68aa926bb30d46adb47fa6efc3b20b4012eaac4.tar.xz
mailman2-a68aa926bb30d46adb47fa6efc3b20b4012eaac4.zip
Obscure email address in the subject line.
-rw-r--r--Mailman/Archiver/HyperArch.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py
index 0440dc6d..84e04856 100644
--- a/Mailman/Archiver/HyperArch.py
+++ b/Mailman/Archiver/HyperArch.py
@@ -406,6 +406,15 @@ class Article(pipermail.Article):
if email:
self.decoded['email'] = email
if subject:
+ if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
+ otrans = i18n.get_translation()
+ try:
+ i18n.set_language(self._lang)
+ atmark = unicode(_(' at '), Utils.GetCharSet(self._lang))
+ subject = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
+ '\g<1>' + atmark + '\g<2>', subject)
+ finally:
+ i18n.set_translation(otrans)
self.decoded['subject'] = subject
self.decoded['stripped'] = self.strip_subject(subject or self.subject)