header:List-Id:asText answered null for a message that has a List-Id header (#642). mail-parser parses List-Id as an address, and into_form(Text) has no conversion from an address, so the value fell through to Null. The raw-bytes path that reads unstructured text was only taken for unstructured headers or asRaw.
Now, when asText is asked for and the stored value isn't text, the raw header is read again with parse_unstructured(), in both header_to_value implementations (parsed message and stored metadata). Text values (Subject and others) take the same path as before.
inbuxa-webmail asks for header:List-Id:asText, so this also fixes its mailing-list detection.
Tests: structured_headers_as_text_from_the_parsed_message and structured_headers_as_text_from_stored_metadata (List-Id, an encoded Subject, List-Help as text; raw List-Id unchanged). cargo test -p email --lib passes, cargo fmt --all --check is clean, and the fork checks pass.
Not in this PR: refusing forms RFC 8621 §4.1.2 doesn't allow (e.g. header:From:asText) with invalidArguments instead of null. ihasmail still asks for header:List-Unsubscribe:asText, so that check would fail its Email/get against inbuxa outright; it's filed separately for 27.7.
`header:List-Id:asText` answered `null` for a message that has a List-Id header (#642). mail-parser parses List-Id as an address, and `into_form(Text)` has no conversion from an address, so the value fell through to `Null`. The raw-bytes path that reads unstructured text was only taken for unstructured headers or `asRaw`.
Now, when `asText` is asked for and the stored value isn't text, the raw header is read again with `parse_unstructured()`, in both `header_to_value` implementations (parsed message and stored metadata). Text values (Subject and others) take the same path as before.
inbuxa-webmail asks for `header:List-Id:asText`, so this also fixes its mailing-list detection.
Tests: `structured_headers_as_text_from_the_parsed_message` and `structured_headers_as_text_from_stored_metadata` (List-Id, an encoded Subject, List-Help as text; raw List-Id unchanged). `cargo test -p email --lib` passes, `cargo fmt --all --check` is clean, and the fork checks pass.
Not in this PR: refusing forms RFC 8621 §4.1.2 doesn't allow (e.g. `header:From:asText`) with `invalidArguments` instead of `null`. ihasmail still asks for `header:List-Unsubscribe:asText`, so that check would fail its Email/get against inbuxa outright; it's filed separately for 27.7.
Fixes #642
List-Id is parsed as an address, and asText had no conversion from
that, so header:List-Id:asText answered null even when the message had
the header. When asText is asked for and the stored value isn't text,
read the raw header again as unstructured text, in both the parsed and
the stored-metadata paths.
Fixes#642
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
header:List-Id:asTextanswerednullfor a message that has a List-Id header (#642). mail-parser parses List-Id as an address, andinto_form(Text)has no conversion from an address, so the value fell through toNull. The raw-bytes path that reads unstructured text was only taken for unstructured headers orasRaw.Now, when
asTextis asked for and the stored value isn't text, the raw header is read again withparse_unstructured(), in bothheader_to_valueimplementations (parsed message and stored metadata). Text values (Subject and others) take the same path as before.inbuxa-webmail asks for
header:List-Id:asText, so this also fixes its mailing-list detection.Tests:
structured_headers_as_text_from_the_parsed_messageandstructured_headers_as_text_from_stored_metadata(List-Id, an encoded Subject, List-Help as text; raw List-Id unchanged).cargo test -p email --libpasses,cargo fmt --all --checkis clean, and the fork checks pass.Not in this PR: refusing forms RFC 8621 §4.1.2 doesn't allow (e.g.
header:From:asText) withinvalidArgumentsinstead ofnull. ihasmail still asks forheader:List-Unsubscribe:asText, so that check would fail its Email/get against inbuxa outright; it's filed separately for 27.7.Fixes #642