Merge remote-tracking branch 'origin/feature/90_provide-a-way-of-knowing-which-emails-failedsucceeded-in-sending' into feature/90_provide-a-way-of-knowing-which-emails-failedsucceeded-in-sending

# Conflicts:
#	senderror.go
This commit is contained in:
Winni Neessen 2023-01-02 12:15:39 +01:00
commit b8af7a6ffc
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -6,7 +6,7 @@ package mail
import ( import (
"errors" "errors"
"strconv" "fmt"
"strings" "strings"
) )
@ -142,12 +142,5 @@ func (r SendErrReason) String() string {
// isTempError checks the given SMTP error and returns true if the given error is of temporary nature // isTempError checks the given SMTP error and returns true if the given error is of temporary nature
// and should be retried // and should be retried
func isTempError(e error) bool { func isTempError(e error) bool {
ec, err := strconv.Atoi(e.Error()[:3]) return e.Error()[0] == '4'
if err != nil {
return false
}
if ec >= 400 && ec <= 500 {
return true
}
return false
} }