Skip to content

patch: confine Received timestamp extraction to headers - #749

Draft
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/received-header-boundary
Draft

OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/received-header-boundary

Conversation

@OllieinCanada

Copy link
Copy Markdown
Contributor

LF-normalized mail could obtain its Received timestamp from body text and skip mixed-case topmost headers. Stop at the header boundary and match the field name case-insensitively, preserving folding and invalid-topmost fallback.

Offline regressions fail before the repair and pass afterward. Rust 1.90.0: make check-pr passed; 1,151 tests passed, two ignored; formatting and three Clippy profiles passed. The inherited RUST_LOG override was unset. No schema changes or historical data rewrites.

DRAFT: required local Sashiko model self-review is incomplete because provider authentication failed. No clean local review is claimed. Keep as draft until the required review completes and findings are addressed.

Base: d7c69ae
Head: d5396b5

Only CRLF header separators were recognized, so LF-normalized messages
without a Received header could take their received date from body text.
Case-sensitive field matching could also skip the topmost header and
use an older timestamp from a lower Received field.

Stop scanning at the first empty LF or CRLF line and match the exact
field name without ASCII case sensitivity. Preserve folded headers,
the invalid-topmost fallback and the message body.

Add offline regressions through the helper and email parser, including
literal expected timestamps and body preservation checks.

Fixes: 49a4034 ("embargo: use trusted time from Received header")
Signed-off-by: Ollie Slapinski <oliverslapinski@hotmail.com>
@OllieinCanada
OllieinCanada marked this pull request as draft October 26, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant