mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
OAuth2: don't send the "*" command to cancel authentication
XOAUTH2 does not follow the SMTP AUTH RFC
This commit is contained in:
parent
8673addaf0
commit
2a67b397c7
1 changed files with 4 additions and 2 deletions
|
@ -234,8 +234,10 @@ func (c *Client) Auth(a Auth) error {
|
||||||
resp, err = a.Next(msg, code == 334)
|
resp, err = a.Next(msg, code == 334)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// abort the AUTH
|
if mech != "XOAUTH2" {
|
||||||
|
// abort the AUTH. Not required for XOAUTH2
|
||||||
_, _, _ = c.cmd(501, "*")
|
_, _, _ = c.cmd(501, "*")
|
||||||
|
}
|
||||||
_ = c.Quit()
|
_ = c.Quit()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue