Skip to content

Commit

Permalink
server: fix panic on MAIL FROM after failed EHLO
Browse files Browse the repository at this point in the history
Closes: #198
  • Loading branch information
emersion committed Nov 9, 2023
1 parent f00696d commit d62ec8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func (c *Conn) handleGreet(enhanced bool, arg string) {
c.writeResponse(501, EnhancedCode{5, 5, 2}, "Domain/address argument required for HELO")
return
}
c.helo = domain

sess, err := c.server.Backend.NewSession(c)
if err != nil {
Expand All @@ -238,6 +237,8 @@ func (c *Conn) handleGreet(enhanced bool, arg string) {
c.writeResponse(451, EnhancedCode{4, 0, 0}, err.Error())
return
}

c.helo = domain
c.setSession(sess)

if !enhanced {
Expand Down

0 comments on commit d62ec8c

Please sign in to comment.