Sendmail::AccessDB

Sendmail::AccessDB is an interface to the Sendmail access.db list.
Download

Sendmail::AccessDB Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Derek J. Balling
  • Publisher web site:
  • http://search.cpan.org/~dredd/Sendmail-AccessDB-0.09/lib/Sendmail/AccessDB.pm

Sendmail::AccessDB Tags


Sendmail::AccessDB Description

Sendmail::AccessDB is an interface to the Sendmail access.db list. Sendmail::AccessDB is an interface to the Sendmail access.db list.SYNOPSIS use Sendmail::AccessDB qw(spam_friend whitelisted); $friend_or_hater = spam_friend('user@example.com'); $whitelisted = whitelisted('sender@example.com');This module is designed so that users of the Sendmail::Milter module (or other Sendmail programmers) can ascertain if a user has elected to whitelist themselves as a "spam friend" (where there should be no spam filtering on mail to them) or, where spam-filtering is not the default, but an option, where certain receipients have been labeled as "spam haters"USAGE use Sendmail::AccessDB qw(spam_friend); $friend_or_hater = spam_friend('user@example.com');Ordinarily, this will look for such things as "Spam:user@example.com", "Spam:user@", etc., in the /etc/mail/access.db file. There is an optional second argument "Category", which could be used if you wanted to enable specific checks, for example, if you wanted to customize down to a per-check basis, you might use: $rbl_friend_or_hater = spam_friend('user@example.com', 'qualifier' => 'maps_rbl'); $dul_friend_or_hater = spam_friend('user@example.com', 'qualifier' => 'maps_dul'); Caution should be taken when defining your own categories, as they may inadvertantly conflict with Sendmail-defined categories. use Sendmail::AccessDB qw(whitelisted); $whitelisted = whitelisted('sender@example.com'); $whitelisted_host = whitelisted('foo.example.com'); $whitelisted_addr = whitelisted('192.168.1.123');Would check for appropriate whitelisting entries in access.db. Some lookups might be ambiguous, for example: $whitelisted = whitelisted('foobar');where it is hard to know if that is supposed to be a hostname, or a sender. whitelisted() accepts the 'type' argument, such as: $whitelisted = whitelisted('foobar','type'=>'hostname'); $whitelisted = whitelisted('postmaster','type'=>'mail');It's also possible to feed the qualifier argument, if necessary, for example, to do: $whitelisted = whitelisted('host.example.com','type'=>'hostname', 'qualifier' => 'Connect');which would check to see if this host has an OK flag set for the Connect qualifier.There is also the generic "lookup", which, at its simplest, takes a single argument: $rc = lookup('host.example.com');will do a lookup on host.example.com. But if you wanted to pay attention to parent-domains, you might do: $rc = lookup('host.example.com', 'type'=>'hostname');but if you wanted to find out if 'host.example.com', or any of its parent domains ('example.com' and 'com'), had a value in the "MyQual" qualifier, you might do: $rc = lookup('host.example.com','type'=>'hostname','qualifier'=>'MyQual');which would look up, in order 'MyQual:host.example.com', 'MyQual:example.com', and 'MyQual:com', returning the first (most specific) one found. Requirements: · Perl


Sendmail::AccessDB Related Software