3 Commits

3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
Rspamd helper for CommuniGate Pro 5.x, 6.x Rspamd helper for CommuniGate Pro 5.x, 6.x
Copyright (C) 2017-2023 Andrey Igoshin <ai@vsu.ru> Copyright (C) 2017-2023 Andrey Igoshin <ai@vsu.ru>
Version 1.5.0 Version 1.5.6
https://git.vsu.ru/ai/rspamd-cgp https://git.vsu.ru/ai/rspamd-cgp
+4 -3
View File
@@ -28,7 +28,7 @@ var protocol int
func init() { func init() {
reMD = regexp.MustCompile(`^\s+DomainName\s+=\s+([^;]+);`) reMD = regexp.MustCompile(`^\s+DomainName\s+=\s+([^;]+);`)
reSELF = regexp.MustCompile(`^S (?:<([^>]+)> )?(?:DSN|GROUP|LIST|PBX|PIPE|RULE) \[0\.0\.0\.0\]`) 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() err := setMainDomain()
if err != nil { 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) Putline("%d DISCARD\n", seq)
} }
@@ -321,7 +322,7 @@ fin:
if err != nil { if err != nil {
Failure(seq, qid, err) Failure(seq, qid, err)
} else { } else {
Discard(seq) Discard(seq, qid, from, rcpts)
} }
} }
+1 -1
View File
@@ -149,7 +149,7 @@ func Scan(seq int, filename string) {
} }
case "discard": case "discard":
cgp.Discard(seq) cgp.Discard(seq, qid, from, rcpts)
case "quarantine": case "quarantine":
cgp.MirrorTo(seq, qid, mirrorTo, append(headers, headerJunkR), body, mirrorDiscard) cgp.MirrorTo(seq, qid, mirrorTo, append(headers, headerJunkR), body, mirrorDiscard)