stack/apps/backend/src/lib
Aman Ganapathy 3f01358f9d
[Refactor] Make all SMTP 4yz Errors Retryable (#1293)
### Context
The `emails-low-level.tsx` file is where the sending logic of an email
over smtp occurs. It tries to send an email, and if there is an issue it
has logic to mark the email as retryable or not. Then, the
`email-queue-step` itself handles the actual retry efforts based on this
flag and a few other factors (like if max retries have been attempted).
Currently, if an error code isn't explicitly accounted for, it falls
back to being an "unknown error while sending" and is marked as not
retryable.
However, SMTP [defines the 4yz class of error codes as being
retryable](https://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml).

### Summary of Changes
We add fallback logic at the end of the `responseCode` specific block to
mark the 4yz class of error codes as retryable. While the message here
is less specific, that is okay since any codes we want to explicitly
account for are handled above it. The main thing here is that these
should be retried.
2026-04-07 16:20:39 +00:00
..
ai Custom dashboards and unified ai no playground (#1243) 2026-03-13 20:24:40 +00:00
cache.tsx Upgrade Prisma to v7 (#1064) 2025-12-26 08:13:34 -08:00
cel-evaluator.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
clickhouse.tsx Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
config.tsx Local emulator base (#1233) 2026-03-10 15:15:06 -07:00
contact-channel.tsx External db sync (#1036) 2026-02-05 12:04:31 -08:00
dev-perf-stats.tsx Fix dev-perf-stats 2026-02-04 13:59:31 -08:00
dev-request-stats.tsx Fix dev stats accuracy 2025-12-29 17:15:08 +01:00
email-delivery-stats.tsx [Refactor][Feat][Fix] Rework Email Section With New Sent Page, Better Drafts Page, and Settings Page (#1221) 2026-03-11 12:01:36 -07:00
email-drafts.tsx fix types 2025-12-26 18:11:37 +01:00
email-queue-step.tsx Fix CI/CD 2026-03-26 11:10:51 -07:00
email-rendering.test.tsx [Refactor][Feat][Fix] Rework Email Section With New Sent Page, Better Drafts Page, and Settings Page (#1221) 2026-03-11 12:01:36 -07:00
email-rendering.tsx Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
email-template-rewrite.ts Custom dashboards and unified ai no playground (#1243) 2026-03-13 20:24:40 +00:00
emailable.tsx Fix CI/CD 2026-03-26 11:10:51 -07:00
emails-low-level.tsx [Refactor] Make all SMTP 4yz Errors Retryable (#1293) 2026-04-07 16:20:39 +00:00
emails.tsx Managed email provider (#1222) 2026-03-09 20:23:11 -07:00
end-users.tsx Enhance error handling and logging in Emailable response validation (#1292) 2026-04-01 09:21:43 -07:00
events.tsx Fix sign-up rules glitch 2026-02-25 11:15:00 -08:00
external-db-sync-metadata.ts [Refactor] Improve CI Run Times by Reducing Test Flakiness and Speeding up Test Suite (#1166) 2026-02-10 19:43:10 -08:00
external-db-sync-queue.ts Clickhouse sync fixing (#1198) 2026-02-16 11:30:38 -08:00
external-db-sync.ts Clickhouse sync fixing (#1198) 2026-02-16 11:30:38 -08:00
featurebase.tsx Replace Web3Forms with internal feedback emails (#1244) 2026-03-23 17:07:37 -07:00
images.tsx Project logo upload (#817) 2025-08-19 04:45:16 +02:00
internal-api-keys.tsx "Require publishable client key" toggle (#1158) 2026-02-19 10:23:16 -08:00
internal-feedback-emails.tsx Replace Web3Forms with internal feedback emails (#1244) 2026-03-23 17:07:37 -07:00
js-execution.tsx [Refactor] Rework Environment Variable Checks in Email-Rendering Pipeline (#1161) 2026-02-04 16:54:18 -08:00
local-emulator.test.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
local-emulator.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
managed-email-domains.tsx Managed email provider (#1222) 2026-03-09 20:23:11 -07:00
managed-email-onboarding.tsx Managed email provider (#1222) 2026-03-09 20:23:11 -07:00
notification-categories.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
oauth.tsx Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
openapi.tsx Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
payments.test.tsx fix payment data integrity (#1137) 2026-01-28 09:01:43 -08:00
payments.tsx inline product cancelling (#1199) 2026-02-17 20:28:16 -08:00
permissions.tsx fix types 2025-12-26 18:11:37 +01:00
product-versions.tsx [Fix] [Refactor] Implement Base Settings for Stack-Auth Plans and Move Metadata from Stripe Webhook Event to Table (#1214) 2026-02-23 22:09:27 -08:00
projects.tsx Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
redirect-urls.test.tsx [Fix] [Feat] Update OAuth Sign-In and Get Token Functions to Work (#1130) 2026-01-28 02:17:27 +00:00
redirect-urls.tsx [Fix] [Feat] Update OAuth Sign-In and Get Token Functions to Work (#1130) 2026-01-28 02:17:27 +00:00
request-checks.tsx Upgrade Prisma to v7 (#1064) 2025-12-26 08:13:34 -08:00
risk-scores.tsx private files n sm build shit (#1276) 2026-03-23 12:31:36 -07:00
session-replays.tsx Analytics event tracking (#1208) 2026-02-17 18:33:01 -08:00
sign-up-context.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
sign-up-heuristics.tsx Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
sign-up-rules.ts Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
stripe-proxy.tsx one time payments (#865) 2025-09-12 17:14:09 -07:00
stripe.tsx [Fix] [Refactor] Implement Base Settings for Stack-Auth Plans and Move Metadata from Stripe Webhook Event to Table (#1214) 2026-02-23 22:09:27 -08:00
telegram.tsx payment email templates (#1106) 2026-01-20 18:45:01 -08:00
tenancies.tsx Make most queries readonly 2026-01-02 04:25:05 +01:00
tokens.tsx rename signed_up_at_millis JWT claim to signed_up_at 2026-03-30 17:43:06 -07:00
turnstile.tsx Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
types.tsx Upgrade Prisma to v7 (#1064) 2025-12-26 08:13:34 -08:00
upstash.tsx Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
users.tsx Enhance error handling and logging in Emailable response validation (#1292) 2026-04-01 09:21:43 -07:00
webhooks.tsx Rename USER to PROJECT in permissions (#576) 2025-03-27 09:39:48 -07:00