fix sa hook
This commit is contained in:
parent
a07f4a30d6
commit
8cd93abe4f
@ -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[:])
|
||||||
|
c.Close()
|
||||||
|
out.Close()
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_, err = io.CopyBuffer(out, r, buff[:])
|
return ErrSpamFilterFailed
|
||||||
c.Close()
|
|
||||||
out.Close()
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user