Skip to content

Commit

Permalink
fix: incorrect SMTP error handling (#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr authored Nov 22, 2023
1 parent 6d08576 commit ee138ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion courier/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (c *courier) dispatchEmail(ctx context.Context, msg Message) error {
var mailErr *gomail.SendError

switch {
case errors.As(err, &mailErr) && mailErr.Index >= 500:
case errors.As(err, &mailErr) && errors.As(mailErr.Cause, &protoErr) && protoErr.Code >= 500:
fallthrough
case errors.As(err, &protoErr) && protoErr.Code >= 500:
// See https://en.wikipedia.org/wiki/List_of_SMTP_server_return_codes
Expand Down

0 comments on commit ee138ec

Please sign in to comment.