Upstream commit: 9d1c75ab68435e4417337f768291e5f947686203 Enterprise-only files removed or emptied: 63 Enterprise-only snippets removed: 118 in 50 files Dangling module declarations removed: 5 Edits turning enterprise off: 25 Third-party code: 14 files, 0 not in THIRD-PARTY.md Verification: clean One snippet more than v0.16.22, in crates/common/src/auth/authentication.rs (3, was 2).
This commit is contained in:
@@ -17,6 +17,8 @@ use std::{borrow::Cow, future::Future};
|
||||
use store::ahash::AHashMap;
|
||||
use types::blob_hash::BlobHash;
|
||||
|
||||
pub const ORCPT_ADDR_TYPE: &str = "rfc822;";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct IngestMessage {
|
||||
pub sender_address: String,
|
||||
@@ -35,6 +37,12 @@ pub struct IngestRecipient {
|
||||
}
|
||||
|
||||
impl IngestRecipient {
|
||||
pub fn orcpt_parameter(&self) -> Option<String> {
|
||||
self.orcpt
|
||||
.as_deref()
|
||||
.map(|orcpt| format!("{ORCPT_ADDR_TYPE}{orcpt}"))
|
||||
}
|
||||
|
||||
pub fn is_spam(&self) -> bool {
|
||||
self.spam_percentage
|
||||
.is_some_and(|percentage| percentage >= 50)
|
||||
|
||||
@@ -124,6 +124,7 @@ impl SieveScriptIngest for Server {
|
||||
.caused_by(trc::location!())?;
|
||||
|
||||
// Create Sieve instance
|
||||
let orcpt = envelope_to.orcpt_parameter();
|
||||
let mut instance = self.core.sieve.untrusted_runtime.filter_parsed(message);
|
||||
|
||||
// Set account name and email
|
||||
@@ -139,7 +140,7 @@ impl SieveScriptIngest for Server {
|
||||
// Set envelope
|
||||
instance.set_envelope(Envelope::From, envelope_from);
|
||||
instance.set_envelope(Envelope::To, envelope_to.address.as_str());
|
||||
if let Some(orcpt) = &envelope_to.orcpt {
|
||||
if let Some(orcpt) = &orcpt {
|
||||
instance.set_envelope(Envelope::Orcpt, orcpt.as_str());
|
||||
}
|
||||
instance.set_spam_status(spam_status(envelope_to.spam_percentage));
|
||||
|
||||
Reference in New Issue
Block a user