fix(GODT-1623): Throttle SMTP failed requests

If a SMPT client keeps hammering bridge and triggers multiple successive
errors in quick succession, force that client to wait 20 seconds before
trying again.
This commit is contained in:
Leander Beernaert
2023-11-10 12:57:07 +01:00
parent 83bbdbd63e
commit ff288145df
3 changed files with 111 additions and 9 deletions

View File

@ -22,3 +22,4 @@ import "errors"
var ErrInvalidRecipient = errors.New("invalid recipient")
var ErrInvalidReturnPath = errors.New("invalid return path")
var ErrNoSuchUser = errors.New("no such user")
var ErrTooManyErrors = errors.New("too many failed requests, please try again later")