fix sa hook
This commit is contained in:
parent
c4d5ab431a
commit
96a931de3e
@ -3,8 +3,10 @@ package srnd
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"os/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled")
|
var ErrSpamFilterNotEnabled = errors.New("spam filter access attempted when disabled")
|
||||||
@ -36,7 +38,11 @@ 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\nUser: nntpchan\r\n\r\n")
|
u, err := user.Current()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Fprintf(c, "PROCESS SPAMC/1.5\r\nUser: %s\r\n\r\n", u.Username)
|
||||||
io.CopyBuffer(c, msg, buff[:])
|
io.CopyBuffer(c, msg, buff[:])
|
||||||
c.CloseWrite()
|
c.CloseWrite()
|
||||||
r := bufio.NewReader(c)
|
r := bufio.NewReader(c)
|
||||||
|
Reference in New Issue
Block a user