Better configuration

This commit is contained in:
Spitap
2023-04-04 23:17:49 +02:00
committed by Antoine Nguyen
parent 45870e20ef
commit 1423fe0e6e
11 changed files with 218 additions and 22 deletions

View File

@@ -1,11 +1,14 @@
clamav {
scan_mime_parts = true;
scan_text_mime = true;
scan_image_mime = true;
symbol = "CLAM_VIRUS";
type = "clamav";
servers = "127.0.0.1:3310";
servers = "/var/run/clamd.amavisd/clamd.sock";
patterns {
# symbol_name = "pattern";
JUST_EICAR = '^Eicar-Test-Signature$';
JUST_EICAR = "Test.EICAR";
}
}

View File

@@ -1,2 +1,3 @@
%{greylisting_disabled}enabled = false;
servers = "127.0.0.1:6379";
%{postwhite_enabled}whitelisted_ip = "/etc/postfix/postscreen_spf_whitelist.cidr"

View File

@@ -0,0 +1,20 @@
actions {
reject = 15; # normal value is 15, 150 so it will never be rejected
add_header = 6; # set to 0.1 for testing, 6 for normal operation.
rewrite_subject = 8; # Default: 8
greylist = 4; # Default: 4
}
group "antivirus" {
symbol "JUST_EICAR" {
weight = 10;
description = "Eicar test signature";
}
symbol "CLAM_VIRUS_FAIL" {
weight = 0;
}
symbol "CLAM_VIRUS" {
weight = 10;
description = "ClamAV found a Virus";
}
}

View File

@@ -0,0 +1,33 @@
use = ["x-spam-status", "my-x-spam-score" ,"x-virus","authentication-results" ];
extended_spam_headers = false;
skip_local = false;
skip_authenticated = false;
# Write the score as a header
custom {
my-x-spam-score = <<EOD
return function(task, common_meta)
local sc = common_meta['metric_score'] or task:get_metric_score()
-- return no error
return nil,
-- header(s) to add
{['X-Spam-Score'] = string.format('%.2f', sc[1])},
-- header(s) to remove
{['X-Spam-Score'] = 1},
-- metadata to store
{}
end
EOD;
}
routines {
x-virus {
header = "X-Virus";
remove = 1;
symbols = ["CLAM_VIRUS", "JUST_EICAR"];
}
}

View File

@@ -1 +0,0 @@
enable_password = %controller_password