LookupMap






Pair Networks
LookupMap

NAME

LookupMap - query a Dkimproxy-compatible lookup table

SYNOPSIS

  my $map = LookupMap->load("/path/to/mapfile");
  my $result = $map->lookup(
=head1 CONSTRUCTOR

load() - load a lookup table

  my $map = LookupMap->load("/path/to/mapfile");
  my $result = $map->lookup_address('bob@example.org');

METHODS

lookup_address() - find an address in a map file

  my ($result, $key) = $map->lookup_address('bob@example.com');

The address is an email address. this function looks first for the full email address, and if not found, tries more and more general forms of the email addresses

The result is a two element list. The first element is the result found in the map. The second element is the key by which the value was found. E.g. if you looked up bob@example.com but the map only had an entry for example.com, the key would be example.com.

lookup() - lookup a raw value in the map file

  my $result = $map->lookup('10.20.30.40');
  my ($result, $key) = $map->lookup([ '10.20.30.40', '10.20.30', '10.20', '10' ]);