diff options
author | ache <ache@FreeBSD.org> | 2002-03-06 03:22:36 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-03-06 03:22:36 +0000 |
commit | 874d3f5d2b92adeae7ea8a9c8bdf193468299573 (patch) | |
tree | f5b06db426d14366c1c2d4011844c7d325dc5697 /mail/ricochet/files | |
parent | 599d81ed6853e59f89eeecf0b5b5525410d1fcfb (diff) | |
download | FreeBSD-ports-874d3f5d2b92adeae7ea8a9c8bdf193468299573.zip FreeBSD-ports-874d3f5d2b92adeae7ea8a9c8bdf193468299573.tar.gz |
Detect fake hotmail.com headers - sense X-Originating-IP
Diffstat (limited to 'mail/ricochet/files')
-rw-r--r-- | mail/ricochet/files/patch-ricochet | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/mail/ricochet/files/patch-ricochet b/mail/ricochet/files/patch-ricochet index 41245c0..2585c80 100644 --- a/mail/ricochet/files/patch-ricochet +++ b/mail/ricochet/files/patch-ricochet @@ -1,12 +1,46 @@ ---- ricochet.orig Fri Feb 9 03:23:19 2001 -+++ ricochet Fri Sep 7 09:03:59 2001 -@@ -574,7 +574,8 @@ +--- ricochet.orig Wed Mar 6 06:10:54 2002 ++++ ricochet Wed Mar 6 06:12:13 2002 +@@ -233,7 +233,15 @@ + unless ($hdata eq '') { + $hdata =~ s/\n*$//; + $self->debug (1,"o [$_] -- $hdata"); +- my $host = _host ($hdata); my ($NS, $MX); ++ my $host = _host ($hdata); ++ if ($host =~ /^(.*\.)?hotmail\.(msn\.)?com$/i) { ++ my $ip = $header->get ('X-Originating-IP'); ++ if ($ip eq '') { ++ $self->debug (2,"- FAKE hotmail.com, NO X-Originating-IP.\n"); ++ goto EXTFAKE; ++ } ++ } ++ my ($NS, $MX); + if ((_nslookup ($host) && ($NS = 1)) || (_mxlookup ($host) && ($MX = 1))) { + $self->debug (2,"+ $host EXISTS.\n") if $NS; + $self->debug (2,"+ $host HAS A MX RECORD.\n") if $MX; +@@ -244,6 +252,7 @@ + } + } else { $self->debug (2,"- POSSIBLY FAKED HEADER. $host DOESN'T EXIST.\n") } + } ++EXTFAKE: + } @{$self->{EXTRA_HEADERS}}; - sub initialize { - my $self = shift; -- my $rc = "$ENV{RICOCHET}" || "$ENV{HOME}/.ricochet"; $rc .= "/ricochetrc"; -+ my $rc = "$ENV{RICOCHET}" || -d "$ENV{HOME}/.ricochet" ? "$ENV{HOME}/.ricochet" : "%%PREFIX%%/share/ricochet"; -+ $rc .= "/ricochetrc"; - Carp::croak "** Ricochet configuration file $rc doesn't exist. Aborting.\n" unless -e $rc; - open (RC, $rc); + while ($match == 0) { +@@ -406,6 +415,18 @@ + my @transmit_hosts = $by =~ /($HOSTRE)/gs; + + my @ips = $by =~ /($IPRE)/gs; ++ ++ grep { ++ if (/^(.*\.)?hotmail\.(msn\.)?com$/i) { ++ my $header = $self->{MAIL}->head; ++ my $ip = $header->get ('X-Originating-IP'); ++ if ($ip eq '') { ++ $self->debug (2,"- FAKE hotmail.com, NO X-Originating-IP.\n"); ++ return undef; ++ } ++ } ++ } (@transmit_hosts, @orig_hosts); ++ grep { + if (_nslookup ($_)) { + $auth = 1; |