diff options
Diffstat (limited to 'Echolot/Pinger')
-rw-r--r-- | Echolot/Pinger/CPunk.pm | 14 | ||||
-rw-r--r-- | Echolot/Pinger/Mix.pm | 8 |
2 files changed, 16 insertions, 6 deletions
diff --git a/Echolot/Pinger/CPunk.pm b/Echolot/Pinger/CPunk.pm index 6f6e950..3878cff 100644 --- a/Echolot/Pinger/CPunk.pm +++ b/Echolot/Pinger/CPunk.pm @@ -1,7 +1,7 @@ package Echolot::Pinger::CPunk; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: CPunk.pm,v 1.14 2003/02/15 23:35:16 weasel Exp $ +# $Id: CPunk.pm,v 1.15 2003/02/17 14:44:15 weasel Exp $ # =pod @@ -175,15 +175,23 @@ sub encrypt_to($$$$) { return $result; }; -sub ping($$$$) { - my ($body, $to, $chain, $keys) = @_; +sub ping($$$$$) { + my ($body, $to, $with_from, $chain, $keys) = @_; my $msg = $body; for my $hop (reverse @$chain) { + my $header = ''; + if ($with_from) { + my $address = Echolot::Config::get()->{'my_localpart'} . '@' . + Echolot::Config::get()->{'my_domain'}; + $header = "##\nFrom: Echolot Pinger <$address>\n\n"; + $with_from = 0; + }; $msg = "::\n". "Anon-To: $to\n". "\n". + $header. $msg; if ($hop->{'encrypt'}) { diff --git a/Echolot/Pinger/Mix.pm b/Echolot/Pinger/Mix.pm index 6e1072d..f331f2a 100644 --- a/Echolot/Pinger/Mix.pm +++ b/Echolot/Pinger/Mix.pm @@ -1,7 +1,7 @@ package Echolot::Pinger::Mix; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Mix.pm,v 1.12 2003/01/14 06:40:24 weasel Exp $ +# $Id: Mix.pm,v 1.13 2003/02/17 14:44:15 weasel Exp $ # =pod @@ -20,8 +20,8 @@ use strict; use English; use Echolot::Log; -sub ping($$$$) { - my ($body, $to, $chain, $keys) = @_; +sub ping($$$$$) { + my ($body, $to, $with_from, $chain, $keys) = @_; my $chaincomma = join (',', @$chain); @@ -70,6 +70,8 @@ sub ping($$$$) { open(MIX, "|".Echolot::Config::get()->{'mixmaster'}." -m -S -l $chaincomma 2>/dev/null") or Echolot::Log::warn("Cannot exec mixpinger: $!."), return 0; + print MIX "From: Echolot Pinger <$address>\n" + if $with_from; print MIX "To: $to\n\n$body\n"; close (MIX); |