Archived
1
0

fix sa hook

This commit is contained in:
Jeff Becker 2017-11-07 14:30:34 -05:00
parent a07f4a30d6
commit 8cd93abe4f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -10,6 +10,7 @@ import (
) )
var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled") var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled")
var ErrSpamFilterFailed = errors.New("spam filter failed")
type SpamFilter struct { type SpamFilter struct {
addr string addr string
@ -53,11 +54,11 @@ func (sp *SpamFilter) Rewrite(msg io.Reader, out io.WriteCloser) error {
} }
if l == "\n" { if l == "\n" {
r.ReadString(10) r.ReadString(10)
break
}
}
_, err = io.CopyBuffer(out, r, buff[:]) _, err = io.CopyBuffer(out, r, buff[:])
c.Close() c.Close()
out.Close() out.Close()
return err return err
} }
}
return ErrSpamFilterFailed
}