From 69359700b4c498918c0d4766ef7265cb561c6bf0 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 7 Nov 2017 14:25:42 -0500 Subject: [PATCH] fix sa hook --- contrib/backends/srndv2/src/srnd/spam.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/spam.go b/contrib/backends/srndv2/src/srnd/spam.go index 3281045..673a515 100644 --- a/contrib/backends/srndv2/src/srnd/spam.go +++ b/contrib/backends/srndv2/src/srnd/spam.go @@ -46,7 +46,15 @@ func (sp *SpamFilter) Rewrite(msg io.Reader, out io.WriteCloser) error { io.CopyBuffer(c, msg, buff[:]) c.CloseWrite() r := bufio.NewReader(c) - r.ReadString(10) + for { + l, err := r.ReadString(10) + if err != nil { + return err + } + if len(l) == 1 { + break + } + } _, err = io.CopyBuffer(out, r, buff[:]) c.Close() out.Close()