From d749c615b3b8d09d7362c9b012fadc7be2aa1c03 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Sun, 23 Jul 2023 11:04:35 +0200 Subject: [PATCH] G Pas --- gpas.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpas.go b/gpas.go index 404efe5..8c82597 100644 --- a/gpas.go +++ b/gpas.go @@ -65,9 +65,10 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error { // if config.SMTPUsername != "" { // auth = sasl.NewPlainClient("", config.SMTPUsername, config.SMTPPassword) // } + message := buf.Bytes() auth := smtp.PlainAuth("", config.SMTPUsername, config.SMTPPassword, config.SMTPServer) log.Printf("auth: %v", auth) - err = smtp.SendMail(config.SMTPServer+":587", auth, config.SMTPUsername, []string{user.OtherMailbox}, buf) + err = smtp.SendMail(config.SMTPServer+":587", auth, config.SMTPUsername, []string{user.OtherMailbox}, message) if err != nil { log.Printf("email send error %v", err) return err