Merge upstream v0.16.23
Five conflicts, resolved: - crates/common/src/auth/authentication.rs: upstream's get_directory_for_token and JwtClaims replace extract_jwt_domain; the per-domain directory code (DIR-1, DIR-5 to DIR-7) is kept, and the token lookup routes through it. The release's one new Enterprise snippet was the body of get_directory_for_issuer, which stays returning None: a token naming no address gets the server default, as DIR-2 specifies and as v0.16.22 did. - crates/common/src/manager/application.rs: upstream's rewrite of the tests, with the temp directory names renamed again, and the 5(a) notice the name-purge change should have added. - crates/common/src/network/mta.rs: both sides' imports. - crates/main/Cargo.toml: the AGPL-only license kept, version 0.16.23. - Cargo.lock: upstream's, with the fork's crates added by Cargo.
This commit is contained in:
@@ -22,6 +22,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,
|
||||
@@ -40,6 +42,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)
|
||||
|
||||
@@ -126,6 +126,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
|
||||
@@ -141,7 +142,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