Fixed authbackend to include the initial line

This commit is contained in:
Tracker-Friendly 2024-11-25 15:52:51 +00:00
parent 8dd23955ad
commit d1a35d0cce
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ type DatabaseBackend struct {
// AuthenticationBackend is a struct that represents an authentication backend // AuthenticationBackend is a struct that represents an authentication backend
type AuthenticationBackend struct { type AuthenticationBackend struct {
Authenticate func(conn *textproto.Conn) (*Address, error) Authenticate func(initial string, conn *textproto.Conn) (*Address, error)
} }
func readMultilineCodeResponse(conn *textproto.Conn) (int, string, error) { func readMultilineCodeResponse(conn *textproto.Conn) (int, string, error) {
@ -320,7 +320,7 @@ func (fr *Receiver) handleConnection(conn net.Conn) {
} }
continue continue
} else { } else {
address, err := fr.auth.Authenticate(textProto) address, err := fr.auth.Authenticate(strings.TrimPrefix(line, "AUTH "), textProto)
if err != nil { if err != nil {
_ = textProto.PrintfLine("421 4.7.0 Temporary server error") _ = textProto.PrintfLine("421 4.7.0 Temporary server error")
_ = conn.Close() _ = conn.Close()