summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-03-06 03:22:36 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-03-06 03:22:36 +0000
commitd1f75725288389c3734ae463a91788f9dd398385 (patch)
tree24fd878890b8745cff8a3b549cff6be95946e358 /mail
parents|<malloc.h>|<stdlib.h> for the nas build (diff)
Detect fake hotmail.com headers - sense X-Originating-IP
Notes
Notes: svn path=/head/; revision=55610
Diffstat (limited to 'mail')
-rw-r--r--mail/ricochet/Makefile2
-rw-r--r--mail/ricochet/files/patch-ricochet54
2 files changed, 45 insertions, 11 deletions
diff --git a/mail/ricochet/Makefile b/mail/ricochet/Makefile
index ba127762658b..2f7ebe5482e1 100644
--- a/mail/ricochet/Makefile
+++ b/mail/ricochet/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ricochet
PORTVERSION= 0.97
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail
MASTER_SITES= http://vipul.net/perl/sources/spamcontrol/ricochet/
diff --git a/mail/ricochet/files/patch-ricochet b/mail/ricochet/files/patch-ricochet
index 41245c06cf01..2585c80387e8 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;