revert AUTH login method

This commit is contained in:
Aine
2022-11-08 17:37:21 +02:00
parent ebb648807d
commit 8954a7801a

View File

@@ -6,7 +6,6 @@ import (
"os"
"time"
"github.com/emersion/go-sasl"
"github.com/emersion/go-smtp"
"gitlab.com/etke.cc/go/logger"
)
@@ -58,19 +57,6 @@ func NewServer(cfg *Config) *Server {
if log.GetLevel() == "DEBUG" || log.GetLevel() == "TRACE" {
s.Debug = os.Stdout
}
// LOGIN auth method, ref: https://github.com/emersion/go-smtp/issues/41#issuecomment-493601465
s.EnableAuth(sasl.Login, func(conn *smtp.Conn) sasl.Server {
return sasl.NewLoginServer(func(username, password string) error {
state := conn.State()
session, err := receiver.Login(&state, username, password)
if err != nil {
return err
}
conn.SetSession(session)
return nil
})
})
server := &Server{
msa: s,