Changeset 86 for trunk/uribl/URIdb.pm


Ignore:
Timestamp:
09/11/25 17:57:24 (3 days ago)
Author:
Kris Deugau
Message:

/trunk/uribl

Move the %config blurb inside the module so it's not splattered across all
the scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/uribl/URIdb.pm

    r81 r86  
    128128        })
    129129        or die "database inaccessible: ".$DBI::errstr;
    130 #  my $sth = $dbh->prepare("SELECT masklen,ipcount FROM autolist");
    131 #  $sth->execute;
    132 #  while (my ($masklen,$ipcount) = $sth->fetchrow_array) {
    133 #    $autolist{$masklen} = $ipcount;
    134 #  }
     130  my $sth = $dbh->prepare("SELECT key,value FROM misc");
     131  $sth->execute;
     132  while (my ($key,$value) = $sth->fetchrow_array) {
     133    $self->{misc}{$key} = $value;
     134  }
     135  $self->{misc}{blzone} = 'uribl.company.com' if !$self->{misc}{blzone};
    135136  return $dbh;
    136137}
     
    186187  my $sth;
    187188
     189##fixme:  should probably rejig this key to point to a FQDN rather than a "something that will get published under .dnsbl"
     190  my $blzone = ($self->{misc}{blzone} ? $self->{misc}{blzone} : 'uri').".dnsbl";
     191  my $bladmin = ($self->{misc}{bladmin} ? $self->{misc}{bladmin} : 'systems.company.com');
     192  my $blttl = ($self->{misc}{ttl} ? $self->{misc}{ttl} : '900');
     193##fixme:  should probably add some configuration strings for the nameserver value
     194
    188195  if ($target eq 'rbldnsd') {
     196    print $blfh "\$SOA 900 $blzone.dnsbl $bladmin 0 1200 600 600 900\n".
     197        "\$NS 3600 127.0.0.1\n".
     198        "\$TTL $blttl\n";
    189199    print $blfh ":127.0.0.2:Domain found in reported missed-spam, no legitimate root or www content\n";
    190200    $sth = $dbh->prepare("SELECT uri FROM urilist WHERE list=2");
Note: See TracChangeset for help on using the changeset viewer.