Archived
1
0

fix sa hook

This commit is contained in:
Jeff Becker 2017-11-07 14:07:55 -05:00
parent 3ce810775e
commit c4d5ab431a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -1,6 +1,7 @@
package srnd package srnd
import ( import (
"bufio"
"errors" "errors"
"io" "io"
"net" "net"
@ -35,10 +36,12 @@ func (sp *SpamFilter) Rewrite(msg io.Reader, out io.WriteCloser) error {
if err != nil { if err != nil {
return err 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[:]) io.CopyBuffer(c, msg, buff[:])
c.CloseWrite() c.CloseWrite()
_, err = io.CopyBuffer(out, c, buff[:]) r := bufio.NewReader(c)
r.ReadString(10)
_, err = io.CopyBuffer(out, r, buff[:])
c.Close() c.Close()
out.Close() out.Close()
return err return err