Custom spam_kill_level

Antoine Nguyen tonio at ngyn.org
Wed Jul 4 17:09:52 CEST 2012


Le 04/07/2012 16:51, Mark Martinec a écrit :
> Antoine,
>
>> I'm trying to configure a custom spam_kill_level for a specific domain
>> using an SQL policy but amavis doesn't want to apply it. I've already
>> define a custom spam_tag2_level using the same method and it works fine.
>> (example: tag2=1000, kill=1010)
>>
>> I've tested with the GTUBE sample message. The message is put into
>> quarantine and here is what I can see into the headers:
>>
>> X-Spam-Score: 999.001
>> X-Spam-Status: Yes, score=999.001 tag=2 tag2=1000 kill=6.9
>> tests=[ALL_TRUSTED=-1, DNS_FROM_RFC_DSN=0.001, GTUBE=1000] autolearn=no
>>
>> *tag2=1000* corresponds to my custom value
>> *kill=6.9* corresponds to the default value but should be (from my point
>> of view) equal to 1010
>>
>> Does the *spam_kill_level* field differs from the others ?
>
> spam_kill_level is no different than spam_tag2_level in this regards,
> should work the way you expected. A log at a higher log level
> may tell what is happening. Perhaps you have spam_kill_level
> in multiple matching records and the more specific one does
> not have a higher priority field that the less specific.
>
>   Mark

Amavis version used : 2.6.4.

I've increased the logs level and here is what I get :

Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) sql: preparing and 
executing: SELECT users.*, policy.*, users.id FROM users LEFT JOIN 
policy ON users.policy_id=policy.id WHERE users.email IN (?,?,?,?,?) 
ORDER BY users.priority DESC
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql(admin at demo.local) matches, result=(id=>"14", priority=>"7", 
policy_id=>"6", email=>"@demo.local", fullname=>"demo.local", 
local=>"1", id=>"14", policy_name=>"demo.local", virus_lover=>-, 
spam_lover=>-, banned_files_lover=>-, bad_header_lover=>-, 
bypass_virus_checks=>"Y", bypass_spam_checks=>"N", 
bypass_banned_checks=>-, bypass_header_checks=>-, spam_modifies_subj=>-, 
virus_quarantine_to=>-, spam_quarantine_to=>-, banned_quarantine_to=>-, 
bad_header_quarantine_to=>-, clean_quarantine_to=>-, 
other_quarantine_to=>-, spam_tag_level=>-, spam_tag2_level=>"1000", 
spam_kill_level=>"1010", spam_dsn_cutoff_level=>-, 
spam_quarantine_cutoff_level=>-, addr_extension_virus=>-, 
addr_extension_spam=>-, addr_extension_banned=>-, 
addr_extension_bad_header=>-, warnvirusrecip=>-, warnbannedrecip=>-, 
warnbadhrecip=>-, newvirus_admin=>-, virus_admin=>-, banned_admin=>-, 
bad_header_admin=>-, spam_admin=>-, spam_subject_tag=>-, 
spam_subject_tag2=>-, message_size_li...
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) ...mit=>-, 
banned_rulenames=>-, id=>"14")
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(message_size_limit) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[message_size_limit] => undef, "admin at demo.local" does not match

....

Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) CALLING SA check
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) prolong_timer 
spam_scan_sa_finish: timer set to 479 s
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) spam_scan: 
score=999.001 autolearn=no 
tests=[ALL_TRUSTED=-1,DNS_FROM_RFC_DSN=0.001,GTUBE=1000]
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) prolong_timer 
spam_scan: remaining time = 479 s
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_tag_level) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup: (scalar) 
matches, result="2"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_tag_level] => true,  "admin at demo.local" matches, result="2", 
matching_key="(constant:2)"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_tag2_level) "admin at demo.local" result=1000
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_tag2_level] => true,  "admin at demo.local" matches, result="1000", 
matching_key="/cached/"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_tag3_level] => undef, "admin at demo.local" does not match
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup: (scalar) 
matches, result="6.9"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup => true,  
"admin at demo.local" matches, result="6.9", matching_key="(constant:6.9)"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(message_size_limit) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[message_size_limit] => undef, "admin at demo.local" does not match
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_lover) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) query_keys: 
admin at demo.local, admin@, demo.local, .demo.local, .local, .
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_hash(admin at demo.local), no matches
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[Lovers2,spam_lovers] => undef, "admin at demo.local" does not match
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) blocking contents 
category is (6) for admin at demo.local
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) blocking ccat=6, SMTP 
response: 250 2.7.0 Ok, discarded, id=28683-01 - SPAM
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) do_notify_and_quar: 
ccat=Spam (6,0) ("6":Spam, "1,1":CleanTag, "1":Clean, "0":CatchAll) 
ccat_block=(6), qar_mth=
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_tag_level) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup: (scalar) 
matches, result="2"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_tag_level] => true,  "admin at demo.local" matches, result="2", 
matching_key="(constant:2)"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_tag2_level) "admin at demo.local" result=1000
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_tag2_level] => true,  "admin at demo.local" matches, result="1000", 
matching_key="/cached/"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup: (scalar) 
matches, result="6.9"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup => true,  
"admin at demo.local" matches, result="6.9", matching_key="(constant:6.9)"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_quarantine_to) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup: (scalar) 
matches, result="sql:"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_quarantine_to] => true,  "admin at demo.local" matches, 
result="sql:", matching_key="(constant:sql:)"
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup => undef, 
"admin at demo.local", no lookup tables
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_sql_field(spam_admin) "admin at demo.local" result=undef
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) query_keys: 
admin at demo.local, admin@, demo.local, .demo.local, .local, .
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) 
lookup_hash(admin at demo.local), no matches
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup [spam_admin] => 
undef, "admin at demo.local" does not match
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) lookup 
[spam_quarantine_bysender_to] => undef, "spam at example.net" does not match
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: X-Spam-Flag: NO\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: X-Spam-Score: 
999.001\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: X-Spam-Level: 
****************************************************************\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: X-Spam-Status: 
Yes, score=999.001 tag=2 tag2=1000 kill=6.9\n\ttests=[ALL_TRUSTED=-1, 
DNS_FROM_RFC_DSN=0.001, GTUBE=1000]\n\tautolearn=no\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: 
X-Quarantine-ID: <TbP4XWtDAYku>\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: 
X-Envelope-To-Blocked: <admin at demo.local>\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: X-Envelope-To: 
<admin at demo.local>\n
Jul  4 08:02:52 mod-dev amavis[28683]: (28683-01) header: 
X-Envelope-From: <spam at example.net>\n

The database only contains one matching record and it appears Amavis 
finds it.

-- 
Antoine Nguyen
Modoboa developer
http://modoboa.org/


More information about the amavis-users mailing list