mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-21 21:30:50 +01:00
Add fig.StringUnmarshaler support for LOGIN-NOENC and PLAIN-NOENC authentication methods
This commit is contained in:
parent
df1a141368
commit
f79c1b8ebe
2 changed files with 6 additions and 0 deletions
4
auth.go
4
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":
|
||||
|
|
|
@ -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},
|
||||
|
|
Loading…
Reference in a new issue