From 2da4eceafb1c927cf6e96409be2370733fb2ce38 Mon Sep 17 00:00:00 2001 From: "fox.cpp" Date: Mon, 12 Feb 2024 22:17:50 +0300 Subject: [PATCH] target/queue: Use >= to check q.maxTries See #678. --- internal/target/queue/queue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/target/queue/queue.go b/internal/target/queue/queue.go index 2c7a0394..525e40e0 100644 --- a/internal/target/queue/queue.go +++ b/internal/target/queue/queue.go @@ -402,7 +402,7 @@ func (q *Queue) tryDelivery(meta *QueueMetadata, header textproto.Header, body b meta.RcptErrs[rcpt] = toSMTPErr(rcptErr) temporary := exterrors.IsTemporaryOrUnspec(rcptErr) - if !temporary || meta.TriesCount[rcpt]+1 == q.maxTries { + if !temporary || meta.TriesCount[rcpt]+1 >= q.maxTries { delete(meta.TriesCount, rcpt) dl.Msg("not delivered, permanent error", "rcpt", rcpt) failedRcpts = append(failedRcpts, rcpt)