summaryrefslogtreecommitdiff
path: root/Echolot/Mailin.pm
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-06-11 10:00:38 +0000
committerPeter Palfrader <peter@palfrader.org>2002-06-11 10:00:38 +0000
commitd7293e8665c18bbbfbed3b0bcdf58b26db8772ec (patch)
tree34f87fd297321f10822c315ae919fdb3728de465 /Echolot/Mailin.pm
parent62af59dd3f24dbdb9860fc90b03f64b0a78faa36 (diff)
Moved address/mac verification to Tools
Handli incoming Pings
Diffstat (limited to 'Echolot/Mailin.pm')
-rw-r--r--Echolot/Mailin.pm20
1 files changed, 7 insertions, 13 deletions
diff --git a/Echolot/Mailin.pm b/Echolot/Mailin.pm
index ffdefcc..3b28276 100644
--- a/Echolot/Mailin.pm
+++ b/Echolot/Mailin.pm
@@ -1,7 +1,7 @@
package Echolot::Mailin;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Mailin.pm,v 1.2 2002/06/10 06:23:53 weasel Exp $
+# $Id: Mailin.pm,v 1.3 2002/06/11 10:00:38 weasel Exp $
#
=pod
@@ -65,25 +65,19 @@ sub handle($) {
cluck("No To header found in $file"),
return 0;
- my $delimiter = quotemeta( Echolot::Config::get()->{'recipient_delimiter'});
- my ($type, $timestamp, $received_hash) = $to =~ /$delimiter (.*) = (\d+) = ([0-9a-f]+) @/x or
- cluck("Could not parse to header '$to'"),
- return 0;
-
- my $token = $type.'='.$timestamp;
- my $hash = Echolot::Tools::hash($token . Echolot::Globals::get()->{'storage'}->get_secret() );
- my $cut_hash = substr($hash, 0, Echolot::Config::get()->{'hash_len'});
-
- ($cut_hash eq $received_hash) or
- cluck("Hash mismatch in '$to'"),
+ my $address_result = Echolot::Tools::verify_address_tokens($to) or
+ cluck("Verifying '$to' failed"),
return 0;
+
+ my $type = $address_result->{'token'};
+ my $timestamp = $address_result->{'timestamp'};
Echolot::Conf::remailer_conf($body, $type, $timestamp), return 1 if ($type =~ /^conf\./);
Echolot::Conf::remailer_key($body, $type, $timestamp), return 1 if ($type =~ /^key\./);
Echolot::Conf::remailer_help($body, $type, $timestamp), return 1 if ($type =~ /^help\./);
Echolot::Conf::remailer_stats($body, $type, $timestamp), return 1 if ($type =~ /^stats\./);
- Echolot::Ping::receive($body, $type, $timestamp), return 1 if ($type =~ /^ping\./);
+ Echolot::Pinger::receive($body, $type, $timestamp), return 1 if ($type eq 'ping');
cluck("Didn't know what to do with '$to'"),
return 0;