From d1a35d0cce96228bdf046126f8bd57a322f4eb05 Mon Sep 17 00:00:00 2001 From: arzumify Date: Mon, 25 Nov 2024 15:52:51 +0000 Subject: [PATCH] Fixed authbackend to include the initial line --- smtp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smtp.go b/smtp.go index d40183d..1cc0fad 100644 --- a/smtp.go +++ b/smtp.go @@ -58,7 +58,7 @@ type DatabaseBackend struct { // AuthenticationBackend is a struct that represents an authentication backend 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) { @@ -320,7 +320,7 @@ func (fr *Receiver) handleConnection(conn net.Conn) { } continue } else { - address, err := fr.auth.Authenticate(textProto) + address, err := fr.auth.Authenticate(strings.TrimPrefix(line, "AUTH "), textProto) if err != nil { _ = textProto.PrintfLine("421 4.7.0 Temporary server error") _ = conn.Close()