From e368d26fc15d0f76dd03ea0caeee71695a628b7c Mon Sep 17 00:00:00 2001 From: Aine Date: Fri, 23 Sep 2022 10:37:08 +0300 Subject: [PATCH] check full email in AllowAuth --- bot/access.go | 1 + smtp/msa.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/access.go b/bot/access.go index 31064c2..5fc04a1 100644 --- a/bot/access.go +++ b/bot/access.go @@ -3,6 +3,7 @@ package bot import ( "context" "regexp" + "strings" "gitlab.com/etke.cc/go/mxidwc" "maunium.net/go/mautrix/id" diff --git a/smtp/msa.go b/smtp/msa.go index b146854..71d50b2 100644 --- a/smtp/msa.go +++ b/smtp/msa.go @@ -36,8 +36,7 @@ func (m *msa) Login(state *smtp.ConnectionState, username, password string) (smt return nil, errors.New("please, provide an email address") } - mailbox := utils.Mailbox(username) - if !m.bot.AllowAuth(mailbox, password) { + if !m.bot.AllowAuth(username, password) { return nil, errors.New("email or password is invalid") }