Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a13c4b63f0 | |||
| 2f5fc86d3d | |||
| 008f82f0f4 | |||
| 65a41c26db | |||
| 9384b91fb7 | |||
| ce3894864a | |||
| ed96f0c66f |
@@ -1,8 +1,8 @@
|
||||
|
||||
Rspamd helper for CommuniGate Pro 5.x, 6.x
|
||||
|
||||
Copyright (C) 2017-2023 Andrey Igoshin <ai@vsu.ru>
|
||||
Version 1.5.0
|
||||
Copyright (C) 2017-2024 Andrey Igoshin <ai@vsu.ru>
|
||||
Version 1.5.7
|
||||
|
||||
https://git.vsu.ru/ai/rspamd-cgp
|
||||
|
||||
|
||||
@@ -10,9 +10,13 @@ if [ "$1" == "fmt" ]; then
|
||||
go fmt $*
|
||||
elif [ "$1" == "tidy" ]; then
|
||||
go mod tidy
|
||||
elif [ "$1" == "update" ]; then
|
||||
echo "update..."
|
||||
go get -u ./...
|
||||
go mod tidy
|
||||
elif [ "$1" == "vet" ]; then
|
||||
echo "vet..."
|
||||
go vet
|
||||
go vet ./...
|
||||
else
|
||||
go build
|
||||
fi
|
||||
|
||||
+4
-3
@@ -28,7 +28,7 @@ var protocol int
|
||||
func init() {
|
||||
reMD = regexp.MustCompile(`^\s+DomainName\s+=\s+([^;]+);`)
|
||||
reSELF = regexp.MustCompile(`^S (?:<([^>]+)> )?(?:DSN|GROUP|LIST|PBX|PIPE|RULE) \[0\.0\.0\.0\]`)
|
||||
reSMTP = regexp.MustCompile(`^S (?:<([^>]+)> )?(?:SMTP|HTTPU?|AIRSYNC|XIMSS) \[([0-9a-f.:]+)\]`)
|
||||
reSMTP = regexp.MustCompile(`^S (?:<([^>]+)> )?(?:SMTP|HTTPU?|AIRSYNC|XIMSS|IMAP) \[([0-9a-f.:]+)\]`)
|
||||
|
||||
err := setMainDomain()
|
||||
if err != nil {
|
||||
@@ -47,7 +47,8 @@ func AddHeader(seq int, headers []string) {
|
||||
}
|
||||
}
|
||||
|
||||
func Discard(seq int) {
|
||||
func Discard(seq int, qid int, from string, rcpts []string) {
|
||||
Putline("* %d [%d]: Action: discard; from %s, rcpts %s\n", seq, qid, from, strings.Join(rcpts, ","))
|
||||
Putline("%d DISCARD\n", seq)
|
||||
}
|
||||
|
||||
@@ -321,7 +322,7 @@ fin:
|
||||
if err != nil {
|
||||
Failure(seq, qid, err)
|
||||
} else {
|
||||
Discard(seq)
|
||||
Discard(seq, qid, from, rcpts)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module git.vsu.ru/ai/rspamd-cgp
|
||||
|
||||
go 1.18
|
||||
go 1.23
|
||||
|
||||
require github.com/json-iterator/go v1.1.12
|
||||
|
||||
require (
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
)
|
||||
|
||||
@@ -4,8 +4,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ func Scan(seq int, filename string) {
|
||||
}
|
||||
|
||||
case "discard":
|
||||
cgp.Discard(seq)
|
||||
cgp.Discard(seq, qid, from, rcpts)
|
||||
|
||||
case "quarantine":
|
||||
cgp.MirrorTo(seq, qid, mirrorTo, append(headers, headerJunkR), body, mirrorDiscard)
|
||||
|
||||
Reference in New Issue
Block a user