我对virus_name_to_spam_score 有一个奇怪的行为。我正在使用 2 个自定义 Clamav DB。以下是使用 SaneSecurity 时的日志,我们可以看到一切正常:
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) run_av (ClamAV-clamd) result: /var/lib/amavis/tmp/amavis-20170612T105753-04428-qozS1fmk/parts/p004: Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL FOUND\n
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) run_av (ClamAV-clamd): /var/lib/amavis/tmp/amavis-20170612T105753-04428-qozS1fmk/parts INFECTED: Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) lookup_re("Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL") matches key "(?^:^Sanesecurity\\.TestSig_)", result=undef
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) lookup [virus_name_to_spam_score] => undef, "Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL" does not match
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) virus_scan: (Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL), detected by 1 scanners: ClamAV-clamd
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) lookup_re("Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL") matches key "(?^:.*)", result="1"
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) lookup [viruses_that_fake_sender] => true, "Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL" matches, result="1", matching_key="(?^:.*)"
Jun 12 10:57:53 prd-mail-1 amavis[4428]: (04428-01) Virus Sanesecurity.TestSig_Type4_Hdr.2.UNOFFICIAL matches (?^:.*), sender addr ignored
现在,当使用 SecurityInfo.com 时,我可以看到第一次运行时检测到病毒,但随后virus_name_to_spam_score 为空。我想做的是使用 @virus_name_to_spam_score_maps 将来自此列表的电子邮件设置为垃圾邮件,但由于支票为空,因此未发送邮件被返回,并且它们始终被标记为病毒。这是日志:
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) prolong_timer run_av_3: timer 288, was 288, deadline in 479.8 s
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) run_av (ClamAV-clamd) result: /var/lib/amavis/tmp/amavis-20170612T092354-18890-TNOnpS50/parts/p013: SecuriteInfo.com.Spam-4703.UNOFFICIAL FOUND\n/var/lib/amavis/tmp/amavis-20170612T092354-18890-TNOnpS50/parts/p009: SecuriteInfo.com.Spam-4703.UNOFFICIAL FOUND\n
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) run_av (ClamAV-clamd): /var/lib/amavis/tmp/amavis-20170612T092354-18890-TNOnpS50/parts INFECTED:
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) lookup_re(""), no matches
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) lookup [virus_name_to_spam_score] => undef, "" does not match
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) virus_scan: (), detected by 1 scanners: ClamAV-clamd
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) lookup_re("") matches key "(?^:.*)", result="1"
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) lookup [viruses_that_fake_sender] => true, "" matches, result="1", matching_key="(?^:.*)"
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) Virus matches (?^:.*), sender addr ignored
Jun 12 09:25:32 prd-mail-1 amavis[18890]: (18890-02) lookup_sql_field(virus_lover) rec=0, "[email protected]" result: undef
知道什么可能会导致这种情况吗?
答案1
我已经找到答案了。似乎正在使用的 clamav 扫描仪没有返回正确的值,因此我必须更改@av_scanners在/etc/amavis/conf.d/50-用户至以下内容:
@av_scanners = (
#### http://www.clamav.net/
['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
qr/\bOK$/m, qr/\bFOUND$/m,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
);
并重新启动amavis