Permanent failures do not retry
Why it matters
Retrying a hard bounce five times does not deliver the email — it generates five additional bounce events against your sending domain. Bounce rate is the primary metric email providers use to classify senders as spam sources. A sustained bounce rate above 2% triggers deliverability penalties from Gmail and Yahoo that affect all emails from the domain, including transactional messages to valid recipients. CWE-390 covers detection of errors without action; re-throwing permanent failures into the retry pipeline is the application-layer pattern that drives deliverability degradation.
Severity rationale
Medium because repeated retries on permanent failures degrade sender reputation across all recipients rather than causing immediate security or data integrity failures.
Remediation
Acknowledge permanent failures immediately in workers/email.worker.ts without re-throwing into the retry pipeline:
try {
await esp.send(job.data)
} catch (err: unknown) {
const kind = classifyEspError(err)
if (kind === 'permanent') {
await db.recipient.update({
where: { email: job.data.to },
data: { deliverabilityStatus: 'undeliverable', reason: String(err) }
})
logger.warn({ to: job.data.to }, 'Permanent failure — not retrying')
return // Return without throwing — BullMQ marks job complete
}
throw err // Re-throw transient errors for BullMQ backoff
}
Distinguish at minimum: 400 (invalid address), 403 (blocked), and 422 (unsubscribed) as permanent failure codes that must not enter the retry path.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Sending Pipeline & Infrastructure Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-390 — Detection of Error Condition Without Action
- cwe · CWE-400 — Uncontrolled Resource Consumption
Taxons
History
- 2026-04-18·v1.0.0·Initial import from sending-pipeline-infrastructure·automated