summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2019-01-15 09:57:44 +0500
committerSunil Nimmagadda <sunil@nimmagadda.net>2019-01-15 09:57:44 +0500
commitf1b7bf5fb7d7b291c979dfaf20ddec944461b30d (patch)
tree1a38006a38998518bef0de10aeb097c64229a4c8
parentb2310fc0fa108ab1f5133c568fb0226da59fb8e3 (diff)
Adapt https://marc.info/?l=openbsd-cvs&m=154752781911243&w=2
-rw-r--r--filter_rspamd.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/filter_rspamd.go b/filter_rspamd.go
index b0ecede..5e71f2a 100644
--- a/filter_rspamd.go
+++ b/filter_rspamd.go
@@ -90,7 +90,7 @@ func txCleanup(s *session, args []string) {
}
func filterCommit(s *session, args []string) {
- token := args[5]
+ token := args[6]
reason := <-s.ch
if reason != "" {
stdout.Printf("filter-result|%s|%s|reject|%s\n",
@@ -101,7 +101,7 @@ func filterCommit(s *session, args []string) {
}
func filterDataLine(s *session, args []string) {
- token, line := args[5], args[7]
+ token, line := args[6], args[7]
if line != "." {
s.payload.WriteString(line)
s.payload.WriteString("\n")
@@ -213,15 +213,7 @@ func main() {
stdin := bufio.NewScanner(os.Stdin)
for stdin.Scan() {
fields := strings.Split(stdin.Text(), "|")
- switch fields[0] {
- case "report":
- id = fields[5]
- case "filter":
- id = fields[6]
- default:
- log.Fatalf("Unknown kind: %s", fields[0])
- }
- event = fields[4]
+ event, id = fields[4], fields[5]
switch event {
case "link-disconnect":
delete(sessions, id)