mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-07 06:57:37 +03:00
Remove check scoring system
It fits poorly with limited amount of checks that are (and will be) implemented in maddy. Advanced filtering that requires "spam score" logic should be performed by external software such as rspamd. At this point duplicating that logic in maddy makes no sense, since it is highly problematic to integrate it with external software.
This commit is contained in:
parent
9a6b0e6e31
commit
ab1fdac45d
9 changed files with 12 additions and 389 deletions
|
@ -18,14 +18,6 @@ type msgpipelineCfg struct {
|
|||
globalModifiers modify.Group
|
||||
perSource map[string]sourceBlock
|
||||
defaultSource sourceBlock
|
||||
|
||||
// If MsgMeta.CheckScore is higher than that value,
|
||||
// message will be rejected.
|
||||
rejectScore *int
|
||||
|
||||
// If MsgMeta.CheckScore is higher than that value,
|
||||
// MsgMeta.Quarantine will be set.
|
||||
quarantineScore *int
|
||||
}
|
||||
|
||||
func parseMsgPipelineRootCfg(globals map[string]interface{}, nodes []config.Node) (msgpipelineCfg, error) {
|
||||
|
@ -78,26 +70,6 @@ func parseMsgPipelineRootCfg(globals map[string]interface{}, nodes []config.Node
|
|||
return msgpipelineCfg{}, config.NodeErr(&node, "duplicate 'default_source' block")
|
||||
}
|
||||
defaultSrcRaw = node.Children
|
||||
case "quarantine_score":
|
||||
if len(node.Args) != 1 {
|
||||
return msgpipelineCfg{}, config.NodeErr(&node, "exactly one argument required")
|
||||
}
|
||||
|
||||
quarantineScore, err := strconv.Atoi(node.Args[0])
|
||||
if err != nil {
|
||||
return msgpipelineCfg{}, config.NodeErr(&node, "%v", err)
|
||||
}
|
||||
cfg.quarantineScore = &quarantineScore
|
||||
case "reject_score":
|
||||
if len(node.Args) != 1 {
|
||||
return msgpipelineCfg{}, config.NodeErr(&node, "exactly one argument required")
|
||||
}
|
||||
|
||||
rejectScore, err := strconv.Atoi(node.Args[0])
|
||||
if err != nil {
|
||||
return msgpipelineCfg{}, config.NodeErr(&node, "%v", err)
|
||||
}
|
||||
cfg.rejectScore = &rejectScore
|
||||
default:
|
||||
othersRaw = append(othersRaw, node)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue