Mikael,

> I am looking for that piece of documentation that describes exactly how
> amavisd-new does the lookups, what priorities an SQL-based lookup has
> compared to a statical list defined in amavisd.conf and stuff like that
> is the information I need.

The various @*_maps settings are lists of lookup tables. These are
traversed in order as specified in the list, until one lookup returns
a result, at which point the search stops.

Each lookup table can be one of: a list (ACL), a hash, a regexp-list,
a constant, or SQL or LDAP lookup tables. The last two are somewhat
special in that they cannot currently be explicitly specified in
the @*_maps lists, unlike all the other types of lookup tables.
If SQL is enabled, a SQL-type lookup table is implicitly prepended
to each @*_maps list. Similarly the LDAP lookups.

So, if you have for example:

@spam_lovers_maps =
  (\%spam_lovers, \...@spam_lovers_acl, \$spam_lovers_re);

the list specifies three lookup tables if SQL is off, and specifies
four lookup tables with SQL prepended, if SQL is enabled.

The only reason why variables like %spam_lovers, @spam_lovers_acl,
and $spam_lovers_re exist is for compatibility with versions of amavisd
before intruduction of @*_maps variables - each of the three (four) individual
lookup calls were formerly hard-coded into program, in a fixed order.

Amavisd nowadays only cares for what is in @*_maps variables, it no longer
uses variables like %spam_lovers or @spam_lovers_acl directly.
So you may have:

  @spam_lovers_maps = ( {'.example.com'=>0}, 1 };

specifying one hash lookup table and one constant (pseudo) lookup table;
the %spam_lovers, @spam_lovers_acl and $spam_lovers_re will not
be consulted at all.  (but SQL lookups will still be implicitly prepended
to the list, if enabled).

Now, within each type of a lookup table, the search order is
documented in README.lookups. For ACL lists and regexp lists
the search is sequential until a match is found. For hash type
lookup table keys from specific to general are tried.
For SQL lookups, the order is defined by the user-supplies
policy.priority field - it is expected that more specific records
would have a higher priority, e.g. u...@example.org record
should have a higher priority than '@example.org' record,
which in turn should have a higher priority that a catchall
record (if any): '@.' .

  Mark


------------------------------------------------------------------------------
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to