mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +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
|
*sa = SMTPAuthCustom
|
||||||
case "login":
|
case "login":
|
||||||
*sa = SMTPAuthLogin
|
*sa = SMTPAuthLogin
|
||||||
|
case "login-noenc":
|
||||||
|
*sa = SMTPAuthLoginNoEnc
|
||||||
case "none", "noauth", "no":
|
case "none", "noauth", "no":
|
||||||
*sa = SMTPAuthNoAuth
|
*sa = SMTPAuthNoAuth
|
||||||
case "plain":
|
case "plain":
|
||||||
*sa = SMTPAuthPlain
|
*sa = SMTPAuthPlain
|
||||||
|
case "plain-noenc":
|
||||||
|
*sa = SMTPAuthPlainNoEnc
|
||||||
case "scram-sha-1", "scram-sha1", "scramsha1":
|
case "scram-sha-1", "scram-sha1", "scramsha1":
|
||||||
*sa = SMTPAuthSCRAMSHA1
|
*sa = SMTPAuthSCRAMSHA1
|
||||||
case "scram-sha-1-plus", "scram-sha1-plus", "scramsha1plus":
|
case "scram-sha-1-plus", "scram-sha1-plus", "scramsha1plus":
|
||||||
|
|
|
@ -17,10 +17,12 @@ func TestSMTPAuthType_UnmarshalString(t *testing.T) {
|
||||||
{"CRAM-MD5: cram", "cram", SMTPAuthCramMD5},
|
{"CRAM-MD5: cram", "cram", SMTPAuthCramMD5},
|
||||||
{"CUSTOM", "custom", SMTPAuthCustom},
|
{"CUSTOM", "custom", SMTPAuthCustom},
|
||||||
{"LOGIN", "login", SMTPAuthLogin},
|
{"LOGIN", "login", SMTPAuthLogin},
|
||||||
|
{"LOGIN-NOENC", "login-noenc", SMTPAuthLoginNoEnc},
|
||||||
{"NONE: none", "none", SMTPAuthNoAuth},
|
{"NONE: none", "none", SMTPAuthNoAuth},
|
||||||
{"NONE: noauth", "noauth", SMTPAuthNoAuth},
|
{"NONE: noauth", "noauth", SMTPAuthNoAuth},
|
||||||
{"NONE: no", "no", SMTPAuthNoAuth},
|
{"NONE: no", "no", SMTPAuthNoAuth},
|
||||||
{"PLAIN", "plain", SMTPAuthPlain},
|
{"PLAIN", "plain", SMTPAuthPlain},
|
||||||
|
{"PLAIN-NOENC", "plain-noenc", SMTPAuthPlainNoEnc},
|
||||||
{"SCRAM-SHA-1: scram-sha-1", "scram-sha-1", SMTPAuthSCRAMSHA1},
|
{"SCRAM-SHA-1: scram-sha-1", "scram-sha-1", SMTPAuthSCRAMSHA1},
|
||||||
{"SCRAM-SHA-1: scram-sha1", "scram-sha1", SMTPAuthSCRAMSHA1},
|
{"SCRAM-SHA-1: scram-sha1", "scram-sha1", SMTPAuthSCRAMSHA1},
|
||||||
{"SCRAM-SHA-1: scramsha1", "scramsha1", SMTPAuthSCRAMSHA1},
|
{"SCRAM-SHA-1: scramsha1", "scramsha1", SMTPAuthSCRAMSHA1},
|
||||||
|
|
Loading…
Reference in a new issue