Masked email: owners send as their live masks, over JMAP identities and SMTP submission (ME-11)

This commit is contained in:
2026-09-18 16:23:49 -07:00
parent 60d1d8b84a
commit 53ccc8f4de
4 changed files with 31 additions and 0 deletions
+13
View File
@@ -333,6 +333,19 @@ pub async fn ensure_indexed(data: &Store, registry: &RegistryStore) -> trc::Resu
data.write(batch.build_all()).await.map(|_| ())
}
/// Whether an account may send as an address because it's one of the
/// account's live masks (ME-11).
pub async fn sends_as(
data: &Store,
registry: &RegistryStore,
account_id: u32,
address: &str,
) -> trc::Result<bool> {
Ok(resolve(data, registry, address)
.await?
.is_some_and(|mask| mask.object.account_id.document_id() == account_id))
}
/// What an address is, as far as masks go.
#[derive(Debug)]
pub enum Lookup {