Changeset 43


Ignore:
Timestamp:
12/05/14 18:03:52 (10 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Regularize a few things that should be configuration in export-dnsbl
Fix a minor glitch in bitmask application in CIDR/rbldnsd mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/export-dnsbl

    r40 r43  
    7070        ($config{bladmin} ? $config{bladmin} : 'systems.company.com')." 0 1200 600 600 900\n".
    7171        "\$NS 3600 127.0.0.1\n".
    72         "\$TTL 900\n";
     72        "\$TTL ".($config{ttl} ? $config{ttl} : '900')."\n";
    7373
    7474  # more or less raw CIDR block-and-IP info.  rbldnsd format for convenience.
    7575  foreach (sort ipcmp keys %iplist) {
    7676    my $entry;
    77     if ($iplist{$_} > 256) {
    78       if ($iplist{$_} > 65536) {
     77    if ($iplist{$_} >= 256) {
     78      if ($iplist{$_} >= 65536) {
    7979        $entry .= int($iplist{$_}/65536).".";
    8080        $iplist{$_} = $iplist{$_} % 65536;
     
    9797  }
    9898} else {
     99  # default "mode";  tinyDNS data format
    99100  foreach (sort ipcmp keys %iplist) {
    100101    my $entry;
     
    114115    my ($o1,$o2,$o3,$o4) = (/^(\d+)\.([\d*]+)(?:\.([\d*]+)(?:\.([\d*]+))?)?$/);
    115116    print "+".(defined($o4) ? "$o4." : '').(defined($o3) ? "$o3." : '').(defined($o2) ? "$o2." : '').
    116         "$o1.spamhosts.company.com:127.0.0.$entry:900:::\n";
     117        "$o1.".($config{blzone} ? $config{blzone} : 'spamhosts.company.dnsbl').":127.0.0.$entry:"
     118        ($config{ttl} ? $config{ttl} : '900').":::\n";
    117119  }
    118120}
Note: See TracChangeset for help on using the changeset viewer.