Sieve: don't answer auto-submitted mail #235

Merged
jcoffey-dev merged 1 commits from fix/sieve-auto-submitted into main 2026-10-29 17:33:38 +00:00
Owner

Vacation and notify are meant to stay silent for mail with an Auto-Submitted header other than no (RFC 3834; RFC 5230 section 4.6). The vendored sieve-rs looked for that header as HeaderName::Other, but mail-parser 0.11 parses it as HeaderName::AutoSubmitted, so the check never matched. An out-of-office reply (a JMAP VacationResponse compiles to the same vacation action) or a Sieve notify answered other programs' mail, including other autoresponders. The per-sender duplicate check kept a loop with another responder to one reply per period.

Both now match HeaderName::AutoSubmitted. Precedence and X-Auto-Response-Suppress have no named variant in mail-parser, so they still arrive as Other and were never affected.

Found while checking an OPPORTUNITIES item: upstream 0.7.3 fails its own svtests "No reply to auto-submitted mail" and "Notifying on automated messages" for this reason.

Tested:

  • sieve-rs from vendor/sieve-rs with upstream's svtests restored in full: 10 passed (it failed on main with "notified of auto-submitted message").
  • sieve_auto_submitted_mail_gets_no_reply in crates/common (vacation and notify, with no header, no, auto-replied, lower-case auto-generated): passes, and fails without the fix.
  • cargo fmt --all --check is clean, clippy adds nothing new, and the fork checks are clean.

Not a security fix: a forged sender gets the same one reply per period without the header.

Vacation and notify are meant to stay silent for mail with an `Auto-Submitted` header other than `no` (RFC 3834; RFC 5230 section 4.6). The vendored sieve-rs looked for that header as `HeaderName::Other`, but mail-parser 0.11 parses it as `HeaderName::AutoSubmitted`, so the check never matched. An out-of-office reply (a JMAP VacationResponse compiles to the same `vacation` action) or a Sieve `notify` answered other programs' mail, including other autoresponders. The per-sender duplicate check kept a loop with another responder to one reply per period. Both now match `HeaderName::AutoSubmitted`. Precedence and X-Auto-Response-Suppress have no named variant in mail-parser, so they still arrive as `Other` and were never affected. Found while checking an OPPORTUNITIES item: upstream 0.7.3 fails its own svtests "No reply to auto-submitted mail" and "Notifying on automated messages" for this reason. Tested: - sieve-rs from `vendor/sieve-rs` with upstream's svtests restored in full: 10 passed (it failed on main with "notified of auto-submitted message"). - `sieve_auto_submitted_mail_gets_no_reply` in crates/common (vacation and notify, with no header, `no`, `auto-replied`, lower-case `auto-generated`): passes, and fails without the fix. - `cargo fmt --all --check` is clean, clippy adds nothing new, and the fork checks are clean. Not a security fix: a forged sender gets the same one reply per period without the header.
jcoffey-dev added 1 commit 2026-10-29 17:23:30 +00:00
Sieve: don't answer auto-submitted mail
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 9m26s
9bb74298a2
Vacation and notify are meant to stay silent for mail with an
Auto-Submitted header other than "no" (RFC 3834, RFC 5230 section 4.6).
The vendored sieve-rs looked for that header as HeaderName::Other, but
mail-parser 0.11 parses it as HeaderName::AutoSubmitted, so the check
never matched: an out-of-office reply (a JMAP VacationResponse compiles
to the same vacation action) or a Sieve notify answered other programs'
mail, other autoresponders included. The per-sender duplicate check kept
a loop with another responder to one reply per period.

Both now match HeaderName::AutoSubmitted. Upstream 0.7.3 fails its own
svtests "No reply to auto-submitted mail" and "Notifying on automated
messages" for this reason; with the fix both pass, with the rest of the
crate's tests. sieve_auto_submitted_mail_gets_no_reply in crates/common
covers vacation and notify, and fails without the fix.
jcoffey-dev merged commit 8f17ea613d into main 2026-10-29 17:33:38 +00:00
jcoffey-dev deleted branch fix/sieve-auto-submitted 2026-10-29 17:33:38 +00:00
Sign in to join this conversation.