summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Pinger.pm10
-rw-r--r--Echolot/Storage/File.pm23
2 files changed, 23 insertions, 10 deletions
diff --git a/Echolot/Pinger.pm b/Echolot/Pinger.pm
index 545c147..2287dc8 100644
--- a/Echolot/Pinger.pm
+++ b/Echolot/Pinger.pm
@@ -1,7 +1,7 @@
package Echolot::Pinger;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Pinger.pm,v 1.26 2003/02/17 14:44:15 weasel Exp $
+# $Id: Pinger.pm,v 1.27 2003/02/20 14:05:38 weasel Exp $
#
=pod
@@ -138,6 +138,8 @@ sub receive($$$$) {
my $now = time();
my $body;
+ my $bot = 0;
+ my $top = 0;
# < 2.0beta34 didn't encrypt pings.
if ($msg =~ /^-----BEGIN PGP MESSAGE-----/m) {
# work around borken middleman remailers that have a problem with some
@@ -145,6 +147,10 @@ sub receive($$$$) {
# remailers..
# they add an empty line between each usefull line
$msg =~ s/(\r?\n)\r?\n/$1/g if ($msg =~ /^-----BEGIN PGP MESSAGE-----\r?\n\r?\n/m);
+
+ $top = $msg =~ m/^\S.*-----BEGIN PGP MESSAGE-----/s ? 1 : 0;
+ $bot = $msg =~ m/^-----END PGP MESSAGE-----.*\S/s ? 1 : 0;
+
$body = Echolot::Tools::crypt_symmetrically($msg, 'decrypt');
};
$body = $msg unless defined $body;
@@ -177,7 +183,7 @@ sub receive($$$$) {
if (defined $with_from) { # <= 2.0.10 didn't have with_from
my ($from) = $header =~ /From: (.*)/i;
$from = 'undefined' unless defined $from;
- Echolot::Globals::get()->{'storage'}->register_fromline($addr, $type, $with_from, $from);
+ Echolot::Globals::get()->{'storage'}->register_fromline($addr, $type, $with_from, $from, $top, $bot);
};
return 1;
diff --git a/Echolot/Storage/File.pm b/Echolot/Storage/File.pm
index 25d6406..aea5574 100644
--- a/Echolot/Storage/File.pm
+++ b/Echolot/Storage/File.pm
@@ -1,7 +1,7 @@
package Echolot::Storage::File;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: File.pm,v 1.53 2003/02/18 06:38:10 weasel Exp $
+# $Id: File.pm,v 1.54 2003/02/20 14:05:38 weasel Exp $
#
=pod
@@ -1739,18 +1739,21 @@ sub delete_remailercaps($$) {
};
-=item $storage->B<register_fromline>( I<$address>, I<$with_from>, I<$from> )
+=item $storage->B<register_fromline>( I<$address>, I<$with_from>, I<$from>, $I<disclaimer_top>, $I<disclaimer_bot> )
Register that the remailer I<$address> returned the From header
line I<$from>. If I<$with_from> is 1 we had tried to supply our own
From, otherwise not.
+$I<disclaimer_top> and $I<disclaimer_bot> are boolean variables indicating
+presence or absense of any disclaimer.
+
Returns 1, undef on error.
=cut
-sub register_fromline($$$$) {
- my ($self, $address, $type, $with_from, $from) = @_;
+sub register_fromline($$$$$$$) {
+ my ($self, $address, $type, $with_from, $from, $top, $bot) = @_;
defined ($self->{'METADATA'}->{'addresses'}->{$address}) or
Echolot::Log::cluck ("$address does not exist in Metadata address list."),
@@ -1765,11 +1768,13 @@ sub register_fromline($$$$) {
Echolot::Log::cluck ("with_from has evil value $with_from in register_fromline."),
return undef;
- Echolot::Log::debug("registering fromline $address, $type, $with_from, $from.");
+ Echolot::Log::debug("registering fromline $address, $type, $with_from, $from, $top, $bot.");
$self->{'METADATA'}->{'fromlines'}->{$address}->{$type}->{$with_from} = {
last_update => time(),
- from => $from
+ from => $from,
+ disclaim_top => $top,
+ disclaim_bot => $bot,
};
$self->commit();
@@ -1806,8 +1811,10 @@ sub get_fromline($$$$) {
Echolot::Log::cluck ("from is undefined with $addr $type $user_supplied."),
return undef;
- return { last_update => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'last_update'},
- from => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'from'} };
+ return { last_update => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'last_update'},
+ from => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'from'},
+ disclaim_top => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'disclaim_top'},
+ disclaim_bot => $self->{'METADATA'}->{'fromlines'}->{$addr}->{$type}->{$user_supplied}->{'disclaim_bot'} };
}