Jeff,
> My question concerns the priority field. Based on my reading of a few
> README's it seems like the only purpose is as convenience to indicate
> how specific (or "complete") the email address of interest is.
Yes. It allows to consistently stick to a 'first match wins' paradigm
(and the 'search goes from specific to more general')
even with SQL, where a single SELECT (ordering results by priority)
results in potentially multiple matches already in the desired order,
so the first returned record is the right one.
> I'm also curious as to how exactly the list in %k gets generated,
> and what all goes in to it.
# The SQL select clause to fetch per-recipient policy settings
# The %k will be replaced by a comma-separated list of query addresses
# (e.g. full address, domain only, catchall). ...
$sql_select_policy =
'SELECT *, users.id'.
' FROM users LEFT JOIN policy ON users.policy_id=policy.id'.
' WHERE users.email IN (%k) ORDER BY users.priority DESC';
# The SQL select clause to check sender in per-recipient whitelist/blacklist
# The first SELECT argument '?' will be users.id from recipient SQL lookup,
# the %k will be sender addresses (e.g. full address, domain only, catchall).
# Only the first occurrence of '?' will be replaced by users.id, subsequent
# occurrences of '?' will see empty string as an argument. There can be zero
# or more occurrences of %k, lookup keys will be multiplied accordingly.
...
$sql_select_white_black_list =
'SELECT wb FROM wblist LEFT JOIN mailaddr ON wblist.sid=mailaddr.id'.
' WHERE (wblist.rid=?) AND (mailaddr.email IN (%k))'.
' ORDER BY mailaddr.priority DESC';
See also:
sub make_query_keys
(in amavisd) and comments there.
Mark
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/