Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
70 | magnus | 1 | Description: Bail out if a non-IPv4 address is encountered |
2 | Author: Magnus Holmgren <holmgren@debian.org> |
||
3 | Bug-Debian: http://bugs.debian.org/300103 |
||
4 | Bug-Debian: http://bugs.debian.org/479955 |
||
5 | |||
6 | --- sa-exim-4.2.1.orig/Greylisting.pm |
||
7 | +++ sa-exim-4.2.1/Greylisting.pm |
||
8 | @@ -170,16 +172,19 @@ sub greylisting |
||
9 | |||
10 | # connectip is supposed to be untainted now, but I was still getting |
||
11 | # some insecure dependecy error messages sometimes (perl 5.8 problem apparently) |
||
12 | - $connectip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/; |
||
13 | - my ($ipbyte1, $ipbyte2, $ipbyte3, $ipbyte4) = ($1, $2, $3, $4); |
||
14 | - my $ipdir1 = "$option{'dir'}/$ipbyte1"; |
||
15 | - my $ipdir2 = "$ipdir1/$ipbyte2"; |
||
16 | - my $ipdir3 = "$ipdir2/$ipbyte3"; |
||
17 | + unless ($connectip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) { |
||
18 | + warn "Can only handle IPv4 addresses; skipping greylisting call for message $mesgid\n"; |
||
19 | + return 0; |
||
20 | + } |
||
21 | + |
||
22 | + my $ipdir1 = "$option{'dir'}/$1"; |
||
23 | + my $ipdir2 = "$ipdir1/$2"; |
||
24 | + my $ipdir3 = "$ipdir2/$3"; |
||
25 | my $ipdir4; |
||
26 | my $tupletdir; |
||
27 | |||
28 | $ipdir4 = "$ipdir3"; |
||
29 | - $ipdir4 .= "/$ipbyte4" if ($option{'greylistfourthbyte'}); |
||
30 | + $ipdir4 .= "/$4" if ($option{'greylistfourthbyte'}); |
||
31 | $tupletdir = "$ipdir4/$envfrom"; |
||
32 | |||
33 | $tuplet = "$tupletdir/$rcptto"; |