summaryrefslogtreecommitdiffstats
path: root/mail/ricochet/files/patch-ricochet
blob: 2585c80387e827356f98a554e1e3e72506f092fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- 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}}; 
 
     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;
OpenPOWER on IntegriCloud