feat: show received frontmatter fields in the message detail

This commit is contained in:
randogoth 2026-10-03 17:30:22 +03:00
parent 68f5620d35
commit dacbc9de38
5 changed files with 103 additions and 2 deletions

View file

@ -158,6 +158,30 @@ fn plant(dir: &Path) -> Result<(), String> {
true,
)?;
// one inbox mail with the sender's own frontmatter fields, so the
// detail view has a custom header block to show
{
let sender = identity(11);
let uri = Address::parse("alice@example.org")
.unwrap()
.uri(&sender.pk());
let text = build_frontmatter(
&[
("Subject", "canary rollout report"),
("Reply-To", &uri),
("Priority", "high"),
("X-Stage", "canary at 5%"),
],
"The custom fields on this one are the sender's own — carrier shows them between the meta line and the body.",
);
let envelope = seal(&sender, &pk, text.as_bytes(), now() - 12 * 3600, true)
.map_err(|e| e.to_string())?;
let id = message_id(&envelope);
store
.store_inbox(&id, &envelope, now() - 12 * 3600, false, false)
.map_err(|e| e.to_string())?;
}
// requests: senders not in the contact list
deliver(
&identity(31),