From c4d5ab431a8c9564da16e03f03811b65d5c585fb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 7 Nov 2017 14:07:55 -0500 Subject: [PATCH] fix sa hook --- contrib/backends/srndv2/src/srnd/spam.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/spam.go b/contrib/backends/srndv2/src/srnd/spam.go index f6beccb..f557163 100644 --- a/contrib/backends/srndv2/src/srnd/spam.go +++ b/contrib/backends/srndv2/src/srnd/spam.go @@ -1,6 +1,7 @@ package srnd import ( + "bufio" "errors" "io" "net" @@ -35,10 +36,12 @@ func (sp *SpamFilter) Rewrite(msg io.Reader, out io.WriteCloser) error { if err != nil { return err } - io.WriteString(c, "PROCESS SPAMC/1.5\r\n\r\n") + io.WriteString(c, "PROCESS SPAMC/1.5\r\nUser: nntpchan\r\n\r\n") io.CopyBuffer(c, msg, buff[:]) c.CloseWrite() - _, err = io.CopyBuffer(out, c, buff[:]) + r := bufio.NewReader(c) + r.ReadString(10) + _, err = io.CopyBuffer(out, r, buff[:]) c.Close() out.Close() return err