Archived
1
0

fix sa hook

This commit is contained in:
Jeff Becker 2017-11-07 14:33:41 -05:00
parent 58cc8c2365
commit d3ca9dfa33
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -8,6 +8,7 @@ import (
"log" "log"
"net" "net"
"os/user" "os/user"
"strings"
) )
var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled") var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled")
@ -53,8 +54,9 @@ func (sp *SpamFilter) Rewrite(msg io.Reader, out io.WriteCloser) error {
if err != nil { if err != nil {
return err return err
} }
l = strings.TrimSpace(l)
log.Println("SpamFilter:", l) log.Println("SpamFilter:", l)
if l == "\n" { if l == "" {
_, err = io.CopyBuffer(out, r, buff[:]) _, err = io.CopyBuffer(out, r, buff[:])
c.Close() c.Close()
out.Close() out.Close()