fix: bound SMTP sends with explicit connect and send timeouts #176

Merged
rosa merged 1 commit from ops/smtp-send-timeout into main 2026-08-12 02:13:14 +00:00
Owner

lettre's async transport applies its builder timeout only to the TCP connect; the SMTP greeting and command replies have no bound, so a relay that accepts a connection and then stalls could park a mailer worker indefinitely.

  • Set the connect timeout explicitly on the transport builder (5s).
  • Impose a 30s deadline around each whole send, classified as retryable — the same budget discipline as the webmention client.
  • New test: a listener that accepts connections but never sends the SMTP greeting must fail the send retryably within its deadline (it hung before the fix, empirically confirming lettre's builder timeout does not bound reads).

Closes #163

lettre's async transport applies its builder timeout only to the TCP connect; the SMTP greeting and command replies have no bound, so a relay that accepts a connection and then stalls could park a mailer worker indefinitely. - Set the connect timeout explicitly on the transport builder (5s). - Impose a 30s deadline around each whole send, classified as retryable — the same budget discipline as the webmention client. - New test: a listener that accepts connections but never sends the SMTP greeting must fail the send retryably within its deadline (it hung before the fix, empirically confirming lettre's builder timeout does not bound reads). Closes #163
fix: bound SMTP sends with explicit connect and send timeouts
All checks were successful
ci/woodpecker/push/clippy Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
18a897397e
lettre's async transport applies its builder timeout only to the TCP
connect; the SMTP greeting and command replies have no bound, so a relay
that accepts a connection and then stalls could park a mailer worker
indefinitely. Set the connect timeout explicitly (5s) and impose a 30s
deadline around each whole send, classified as retryable — the same
budget discipline as the webmention client.

Closes #163
rosa merged commit cd3edc08c3 into main 2026-08-12 02:13:14 +00:00
rosa deleted branch ops/smtp-send-timeout 2026-08-12 02:13:14 +00:00
Sign in to join this conversation.
No description provided.