Email/get: refuse header forms RFC 8621 does not allow (invalidArguments, not null) #645

Open
opened 2026-11-25 20:29:59 +00:00 by jcoffey-dev · 0 comments
Owner

RFC 8621 §4.1.2 lists which parsed forms each header field defined in RFC 5322 or RFC 2369 may be fetched in (for example asText only for Subject, Comments and Keywords among those; asAddresses for From, To, Cc and the like; asURLs for the List-* fields of RFC 2369; Return-Path and Received raw only). Any other header field may use every form. The server should refuse a form that isn't allowed with invalidArguments.

inbuxa answers those requests with null instead (found with #642, e.g. header:From:asText). A client can't tell that from a missing header.

Fix: validate the form in HeaderProperty::parse (crates/jmap-proto/src/object/email.rs); a None there already makes the property invalid. A draft is straightforward (a table of the RFC 5322 / 2369 fields and their forms).

Before turning it on: ihasmail asks for header:List-Unsubscribe:asText, which this would refuse, failing its whole Email/get against an inbuxa server. Change ihasmail to asURLs (or raw) first, and check other clients we know of. inbuxa-webmail's requests are all allowed. One of our own tests (tests/src/smtp/inbound/data.rs, header:Return-Path:asText:all) needs to move to the raw form.

RFC 8621 §4.1.2 lists which parsed forms each header field defined in RFC 5322 or RFC 2369 may be fetched in (for example `asText` only for Subject, Comments and Keywords among those; `asAddresses` for From, To, Cc and the like; `asURLs` for the List-* fields of RFC 2369; Return-Path and Received raw only). Any other header field may use every form. The server should refuse a form that isn't allowed with `invalidArguments`. inbuxa answers those requests with `null` instead (found with #642, e.g. `header:From:asText`). A client can't tell that from a missing header. **Fix:** validate the form in `HeaderProperty::parse` (`crates/jmap-proto/src/object/email.rs`); a `None` there already makes the property invalid. A draft is straightforward (a table of the RFC 5322 / 2369 fields and their forms). **Before turning it on:** ihasmail asks for `header:List-Unsubscribe:asText`, which this would refuse, failing its whole Email/get against an inbuxa server. Change ihasmail to `asURLs` (or raw) first, and check other clients we know of. inbuxa-webmail's requests are all allowed. One of our own tests (`tests/src/smtp/inbound/data.rs`, `header:Return-Path:asText:all`) needs to move to the raw form.
jcoffey-dev added this to the 27.7 milestone 2026-11-25 20:29:59 +00:00
jcoffey-dev self-assigned this 2026-11-26 00:21:26 +00:00
jcoffey-dev added the bug
priority
p3
labels 2026-11-26 00:23:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#645