Peter wrote:
>> >> > I am testing a spam mailbox along with 3 user entries:
>> >> > 1. email ([EMAIL PROTECTED]), priority 10
>> >> > 2. domain (domain.com), priority 7
>> >> > 3. other, priority 0
>>
>> Lookup is performed from the most specific, to the most general.
>> First non-empty match wins. ("A match aborts further fetching
>> sequence.")
> So what is the purpose of the users.priority field then?
My statement is only true if the priorities are set correctly,
otherwise it would change this lookup behavior. As I said:
>> This is generally how I perceive what happens (or at least
>> what should happen if the database is configured correctly).
>> U=undef, F1-F6 are fields, '' = empty string, - = NULL.
>>
>> F1 F2 F3 F4 F5 F6
>> [EMAIL PROTECTED] A - - - - -
>> @domain B - '' 5 - -
>> @. (catchall) C - - 6 - 5
>> $something_static U 6 U 7 U U
>>
>> result for [EMAIL PROTECTED] A 6 '' 5 U 5
>>
>From the source code:
# 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). Use ORDER, if there
# is a chance that multiple records will match - the first match wins
# If field names are not unique (e.g. 'id'), the later field overwrites the
# earlier in a hash returned by lookup, which is why we use '*,users.id'.
$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';
So, what I get from this is, is in order to maintain the lookup order of:
[EMAIL PROTECTED]
@domain
@.
the priorities would have to reflect this order.
Again, I hope I am understanding this correctly, please correct me if
I am not.
Gary V
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
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/