Skip to content

Commit

Permalink
fix: client: Helo can be called multiple times (EHLO after STARTTLS).
Browse files Browse the repository at this point in the history
  • Loading branch information
d--j committed Mar 3, 2023
1 parent 8f54a28 commit bae43fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (s *ClientSession) readAction(skipOk bool) (*Action, error) {
switch act.Type {
case ActionSkip:
if !skipOk {
return nil, fmt.Errorf("action read: unexpected skip message received (can only be received after SMFIC_BODY when SMFIP_SKIP was negotiated)")
return nil, fmt.Errorf("action read: unexpected skip message received (can only be received after SMFIC_RCPT, SMFIC_HEADER, SMFIC_BODY when SMFIP_SKIP was negotiated)")
}
case ActionReject:
act.SMTPCode = 550
Expand Down Expand Up @@ -507,7 +507,7 @@ func (s *ClientSession) Conn(hostname string, family ProtoFamily, port uint16, a
//
// It should be called once per milter session (from Client.Session to Close).
func (s *ClientSession) Helo(helo string) (*Action, error) {
if s.state != clientStateConnectCalled {
if s.state != clientStateConnectCalled && s.state != clientStateHeloCalled {
return nil, s.errorOut(fmt.Errorf("milter: in wrong state %d", s.state))
}

Expand Down

0 comments on commit bae43fb

Please sign in to comment.