From 8e565cd80faa4791fd2158b82a2f3fea96120bb1 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 13 Sep 2008 18:31:51 -0300 Subject: [PATCH] now with rot13! --- IkiWiki/Plugin/mailbox.pm | 11 ++++++++++- test/test.setup | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/mailbox.pm b/IkiWiki/Plugin/mailbox.pm index 75a64d61b..207388425 100644 --- a/IkiWiki/Plugin/mailbox.pm +++ b/IkiWiki/Plugin/mailbox.pm @@ -118,11 +118,20 @@ sub format_thread(@){ sub sanitize_address($$){ my $hdrname=shift; my $val=shift; + my $strategy= $config{mailbox_obfuscation_strategy} || "delete"; + + return $val if ($strategy eq "none"); if ($hdrname =~ qr/From|To|Reply-To|CC/){ my @addrs=Email::Address->parse($val); foreach my $addr (@addrs){ - $addr->address("DELETED"); + if ($strategy eq "rot13"){ + my $orig=$addr->address; + $orig =~ y/A-Za-z/N-ZA-Mn-za-m/; + $addr->address($orig); + } else { + $addr->address(gettext("address deleted")); + } } $val=join(",",map {$_->format;} @addrs); } diff --git a/test/test.setup b/test/test.setup index 82b725e30..8d2d32683 100644 --- a/test/test.setup +++ b/test/test.setup @@ -204,4 +204,5 @@ use IkiWiki::Setup::Standard { # For use with the attachment plugin, a program that returns # nonzero if its standard input contains an virus. #virus_checker => "clamdscan -", + mailbox_obfuscation_strategy=>"rot13" } -- 2.26.2