Repository navigation
Description
Finding
PR #4267 (fix for #1899) added three bounds to SmtpSink's SMTP reply reader in directory_mail.rs: a total deadline, a per-line byte cap (MAX_REPLY_LINE_BYTES, 8192), and a per-reply continuation-line cap (MAX_REPLY_CONTINUATION_LINES, 100). The deadline and the line cap each got a dedicated fake-relay regression test. The continuation cap got none — and the tests that look closest cannot reach it:
a_trickling_reply_fails_at_the_total_deadlineuses a relay that sends one250-continuation line every 50 ms and a 300 ms send timeout, so the send fails at the deadline after ~6 continuation lines — the counter never approaches 100.- The byte-trickle and over-long-line tests exercise the deadline and the line cap, not the continuation count.
So the continuations <= MAX_REPLY_CONTINUATION_LINES refusal can be deleted or broken (off-by-one, counter reset per line, cap raised) and every test in the suite stays green. The bound is part of the #1899 hardening: without it, a relay that answers promptly but endlessly with continuation lines is bounded only by the 10 s total deadline, not by the documented 100-line reply bound.
Evidence
- Source PR: fix(id): total deadline + line bound for SmtpSink reply reader (#1899) #4267 (merge commit c2b908b, ancestor-verified against current main 8b522c1).
- On current main the code lives at
pkgs/id/crates/id-directory/src/directory_mail.rs(moved in the id crate restructure): the cap constant at line 224, the counting/refusal inexpectat lines 358–376 (continuations += 1; ensure!(continuations <= MAX_REPLY_CONTINUATION_LINES, ...)). - The same file's tests (lines ~866–985) contain exactly the three PR fix(id): total deadline + line bound for SmtpSink reply reader (#1899) #4267 regressions — trickling reply (300 ms timeout, 50 ms trickle), byte-trickling line, over-long line — and no test that sends more than 100 continuation lines inside the deadline. Verified by reading the file on main twice (contents API + targeted greps for
continuation/CONTINUATION). - Dedupe: issue searches for
MAX_REPLY_CONTINUATION_LINES, "SMTP reply continuation", and "directory_mail continuation test" return only closed id(directory_mail): SmtpSink's reply reader has no total deadline and no line bound — a trickling or never-terminating relay reply hangs the directory request forever #1899 (the parent fix) — no open or closed issue covers this test gap.
Why it matters
#1899's fix was a hardening change against a hostile or broken relay. Two of its three bounds are pinned by tests; the third is a three-line ensure! that a future refactor of expect/read_reply_line can silently drop. A prompt endless-continuation relay is exactly the case the deadline tests do not cover at the cap boundary, so the regression would ship unnoticed.
Acceptance criteria
- A fake-relay test in the
directory_mailtest module sends more thanMAX_REPLY_CONTINUATION_LINEScontinuation lines promptly (well inside the send deadline) and asserts the send fails with the continuation-cap error ("more than 100 continuation lines"), not the deadline error. - A control at or under the cap (e.g. a reply with a handful of continuation lines followed by a final line) still succeeds, pinning that the cap counts continuations per reply.
- Existing directory_mail tests keep passing.
Activity
developing-today commentedon Nov 14, 2026
CODE-3743
dezren39 commentedon Nov 14, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 16, 2026
agent-note:v1
state: triaged
task: 17332
lane: code-b
date: 2026-11-16
Inline triage of #10365 — finding CONFIRMED against current main this shift (file read from main via the contents API):
Triage decision:
250-lines immediately, well inside the send deadline; assert the continuation-cap error text, not the deadline error; control: a handful of continuation lines then a final line succeeds).The fix is enqueued as a follow-on small_fix task (named in the completion record) because it is code+test work on the laptop surface, which is down this shift; this triage task completes as triaged with the follow-on named, per the reasoned-split rule.
dezren39 commentedon Nov 16, 2026
Agent note — task 17498 capacity-parked: laptop route down (lane code-d, 2026-11-16)
State: parked (capacity — laptop unavailable)
Merge pull request #10789 from developing-today/queue/17498-10365-smt…