Changeset 37
- Timestamp:
- 11/23/11 15:44:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/export-dnsbl
r34 r37 60 60 # more or less raw CIDR block-and-IP info. rbldnsd format for convenience. 61 61 foreach (sort ipcmp keys %iplist) { 62 my $out = "$_:127.0.0.$iplist{$_}:". 62 my $entry; 63 if ($iplist{$_} > 256) { 64 if ($iplist{$_} > 65536) { 65 $entry .= int($iplist{$_}/65536)."."; 66 $iplist{$_} = $iplist{$_} % 65536; 67 } else { 68 $entry .= "0."; 69 } 70 $entry .= int($iplist{$_}/256)."."; 71 $iplist{$_} = $iplist{$_} % 256; 72 } else { 73 $entry .= "0.0."; 74 } 75 $entry .= $iplist{$_}; 76 my $out = "$_:127.$entry:". 63 77 ($iplist{$_} & 2 ? 64 78 ($config{iplisted} ? $config{iplisted} : '$ relayed a reported spam') : … … 70 84 } else { 71 85 foreach (sort ipcmp keys %iplist) { 86 my $entry; 87 if ($iplist{$_} > 256) { 88 if ($iplist{$_} > 65536) { 89 $entry .= int($iplist{$_}/65536)."."; 90 $iplist{$_} = $iplist{$_} % 65536; 91 } else { 92 $entry .= "0."; 93 } 94 $entry .= int($iplist{$_}/256)."."; 95 $iplist{$_} = $iplist{$_} % 256; 96 } else { 97 $entry .= "0.0."; 98 } 99 $entry .= $iplist{$_}; 72 100 my ($o1,$o2,$o3,$o4) = (/^(\d+)\.([\d*]+)(?:\.([\d*]+)(?:\.([\d*]+))?)?$/); 73 101 print "+".(defined($o4) ? "$o4." : '').(defined($o3) ? "$o3." : '').(defined($o2) ? "$o2." : ''). 74 "$o1.spamhosts.company.com:127.0.0.$ iplist{$_}:900:::\n";102 "$o1.spamhosts.company.com:127.0.0.$entry:900:::\n"; 75 103 } 76 104 }
Note:
See TracChangeset
for help on using the changeset viewer.