Masked emails: Return UnknownRecipient only for disabled or expired masked emails

This commit is contained in:
Maurus Decimus
2026-07-05 09:56:35 +02:00
parent 00ca557340
commit 4b8ea03e7e
2 changed files with 8 additions and 5 deletions

View File

@@ -76,14 +76,14 @@ impl Server {
if self.is_enterprise_edition()
&& let Cow::Borrowed(addr) = &local_part
&& let Some(masked_id) = crate::enterprise::masked::MaskedAddress::parse(addr)
{
// Masked email resolution
return if let Some(masked_entry) = self
&& let Some(masked_entry) = self
.registry()
.object::<MaskedEmail>(Id::new(masked_id))
.await
.caused_by(trc::location!())?
&& masked_entry.enabled
{
// Masked email resolution
return if masked_entry.enabled
&& masked_entry
.expires_at
.is_none_or(|at| at.timestamp() > now() as i64)