2
0
forked from drew/smtprelay

Fixes for new authentication code

This commit is contained in:
Bernhard Froehlich
2019-01-07 11:52:25 +00:00
parent 3a96014c70
commit b9d1663a18
2 changed files with 2 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ func AuthLoadFile(file string) error {
}
func AuthReady() bool {
return (filename == "")
return (filename != "")
}
func AuthFetch(username string) (string, string, error) {

View File

@@ -87,6 +87,7 @@ func recipientChecker(peer smtpd.Peer, addr string) error {
func authChecker(peer smtpd.Peer, username string, password string) error {
err := AuthCheckPassword(username, password)
if err != nil {
log.Printf("Auth error: %v\n", err)
return smtpd.Error{Code: 535, Message: "Authentication credentials invalid"}
}
return nil