mailcow dockerized

This commit is contained in:
andryyy
2016-12-09 20:39:02 +01:00
commit 5f04dc0b04
96 changed files with 10163 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
sign_condition =<<EOD
return function(task)
local from = task:get_from('smtp')
if from and from[1]['addr'] then
lastAtSymbol = from[1]['addr']:find("[^%@]+$")
local domain = from[1]['addr']:sub(lastAtSymbol, #from[1]['addr'])
local keyfile = io.open("/etc/rspamd/dkim/keys/" .. domain .. ".default")
if keyfile then
keyfile:close()
return {
key = "/etc/rspamd/dkim/keys/" .. domain .. ".default",
domain = domain,
selector = "default"
}
end
end
return false
end
EOD;

View File

@@ -0,0 +1,14 @@
symbol "MAILCOW_AUTH" {
description = "mailcow authenticated";
score = -20.0;
}
group "bayes" {
symbol "BAYES_SPAM" {
weight = 7.5;
description = "Message probably spam, probability: ";
}
symbol "BAYES_HAM" {
weight = -2.5;
description = "Message probably ham, probability: ";
}
}

View File

@@ -0,0 +1 @@
servers = "redis:6379";

View File

@@ -0,0 +1,59 @@
classifier "bayes" {
tokenizer {
name = "osb";
}
backend = "redis";
servers = "redis:6379";
min_tokens = 11;
min_learns = 200;
autolearn = true;
per_user = <<EOD
return function(task)
local rcpt = task:get_recipients(1)
if rcpt then
one_rcpt = rcpt[1]
if one_rcpt['domain'] then
return one_rcpt['domain']
end
end
return nil
end
EOD
statfile {
symbol = "BAYES_HAM";
spam = false;
}
statfile {
symbol = "BAYES_SPAM";
spam = true;
}
learn_condition =<<EOD
return function(task, is_spam, is_unlearn)
local prob = task:get_mempool():get_variable('bayes_prob', 'double')
if prob then
local in_class = false
local cl
if is_spam then
cl = 'spam'
in_class = prob >= 0.95
else
cl = 'ham'
in_class = prob <= 0.05
end
if in_class then
return false,string.format('already in class %s; probability %.2f%%',
cl, math.abs((prob - 0.5) * 200.0))
end
end
return true
end
EOD
}

View File

@@ -0,0 +1,9 @@
rspamd_config.MAILCOW_AUTH = {
callback = function(task)
local uname = task:get_user()
if uname then
return 1
end
end
}

View File

@@ -0,0 +1,3 @@
type = "console";
systemd = false;
.include "$CONFDIR/logging.inc"

View File

@@ -0,0 +1,2 @@
bind_socket = "*:11334";
enable_password ="$2$ibe1yt89kq5rtb9juy8z7cmkt1yg5d9w$bezuyyo8o4kge13rzj8epasdf6ojsgo1jgojce8msbt5bsq9n3dy";

View File

@@ -0,0 +1 @@
bind_socket = "*:11333";