Skip to content

Commit

Permalink
Disable AUTH when AuthSession.AuthMechanisms is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Mar 28, 2024
1 parent c5e530a commit 8063c1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,16 @@ func (c *Conn) handleGreet(enhanced bool, arg string) {
caps = append(caps, "STARTTLS")
}
if c.authAllowed() {
mechs := c.authMechanisms()

authCap := "AUTH"
for _, name := range c.authMechanisms() {
for _, name := range mechs {
authCap += " " + name
}

caps = append(caps, authCap)
if len(mechs) > 0 {
caps = append(caps, authCap)
}
}
if c.server.EnableSMTPUTF8 {
caps = append(caps, "SMTPUTF8")
Expand Down

0 comments on commit 8063c1a

Please sign in to comment.