소스 검색

Fixes for new authentication code

Bernhard Froehlich 6 년 전
부모
커밋
b9d1663a18
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      auth.go
  2. 1 0
      main.go

+ 1 - 1
auth.go

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

+ 1 - 0
main.go

@@ -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