From f79c1b8ebeaf0df7aeef43fa9d5ef3816bbba08b Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Tue, 22 Oct 2024 16:09:12 +0200 Subject: [PATCH] Add fig.StringUnmarshaler support for LOGIN-NOENC and PLAIN-NOENC authentication methods --- auth.go | 4 ++++ auth_test.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/auth.go b/auth.go index 5797731..66254ee 100644 --- a/auth.go +++ b/auth.go @@ -182,10 +182,14 @@ func (sa *SMTPAuthType) UnmarshalString(value string) error { *sa = SMTPAuthCustom case "login": *sa = SMTPAuthLogin + case "login-noenc": + *sa = SMTPAuthLoginNoEnc case "none", "noauth", "no": *sa = SMTPAuthNoAuth case "plain": *sa = SMTPAuthPlain + case "plain-noenc": + *sa = SMTPAuthPlainNoEnc case "scram-sha-1", "scram-sha1", "scramsha1": *sa = SMTPAuthSCRAMSHA1 case "scram-sha-1-plus", "scram-sha1-plus", "scramsha1plus": diff --git a/auth_test.go b/auth_test.go index 2b8b796..a73eaca 100644 --- a/auth_test.go +++ b/auth_test.go @@ -17,10 +17,12 @@ func TestSMTPAuthType_UnmarshalString(t *testing.T) { {"CRAM-MD5: cram", "cram", SMTPAuthCramMD5}, {"CUSTOM", "custom", SMTPAuthCustom}, {"LOGIN", "login", SMTPAuthLogin}, + {"LOGIN-NOENC", "login-noenc", SMTPAuthLoginNoEnc}, {"NONE: none", "none", SMTPAuthNoAuth}, {"NONE: noauth", "noauth", SMTPAuthNoAuth}, {"NONE: no", "no", SMTPAuthNoAuth}, {"PLAIN", "plain", SMTPAuthPlain}, + {"PLAIN-NOENC", "plain-noenc", SMTPAuthPlainNoEnc}, {"SCRAM-SHA-1: scram-sha-1", "scram-sha-1", SMTPAuthSCRAMSHA1}, {"SCRAM-SHA-1: scram-sha1", "scram-sha1", SMTPAuthSCRAMSHA1}, {"SCRAM-SHA-1: scramsha1", "scramsha1", SMTPAuthSCRAMSHA1},