High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Fix auth validation (when no creds are configured in settings) issue in 3rd party bounce providers.
Kailash Nadh80d93e3c3152
diff --git a/internal/bounce/webhooks/forwardemail.go b/internal/bounce/webhooks/forwardemail.goindex e08c5e96..2f73f6d2 100644--- a/internal/bounce/webhooks/forwardemail.go+++ b/internal/bounce/webhooks/forwardemail.go@@ -47,6 +47,10 @@ func NewForwardemail(key []byte) *Forwardemail {}func (p *Forwardemail) ProcessBounce(sigHex string, body []byte) ([]models.Bounce, error) {+ if len(p.hmacKey) == 0 {+ return nil, errors.New("webhook key is not configured")+ }+// Decode the hex-encoded signature from the webhooksig, err := hex.DecodeString(sigHex)if err != nil {diff --git a/internal/bounce/webhooks/lettermint.go b/internal/bounce/webhooks/lettermint.goindex 235918d2..36352131 100644--- a/internal/bounce/webhooks/lettermint.go+++ b/internal/bounce/webhooks/lettermint.go@@ -43,6 +43,10 @@ func NewLettermint(key []byte) *Lettermint {// ProcessBounce processes an incoming Lettermint webhook payload and returns a bounce object.func (l *Lettermint) ProcessBounce(sig string, body []byte) ([]models.Bounce, error) {+ if len(l.hmacKey) == 0 {+ return nil, fmt.Errorf("webhook key is not configured")+ }+// Parse the signature header: t={timestamp},v1={hex_signature}.ts, sigHex, err := parseLettermintSignature(sig)if err != nil {diff --git a/internal/bounce/webhooks/postmark.go b/internal/bounce/webhooks/postmark.goindex 00f3c626..156d2bb7 100644--- a/internal/bounce/webhooks/postmark.go+++ b/internal/bounce/webhooks/postmark.go@@ -3,6 +3,7 @@ package webhooksimport ("crypto/subtle""encoding/json"+ "errors""fmt""strings""time"@@ -106,7 +107,7 @@ func makePostmarkAuthHandler(cfgUser, cfgPassword string) func(username, passworreturn func(username, password string, c echo.Context) (bool, error) {if len(u) == 0 || len(p) == 0 {- return true, nil+ return false, errors.New("webhook credentials are not configured")}if subtle.ConstantTimeCompare([]byte(username), u) == 1 && subtle.ConstantTimeCompare([]byte(password), p) == 1 {