mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-05 10:08:56 +00:00
rustfmt again
This commit is contained in:
@@ -28,7 +28,6 @@ mod http_inject_template_syntax_error;
|
||||
mod http_liveness;
|
||||
mod idna_starttls;
|
||||
mod inspect_ready_q;
|
||||
mod resolve_egress_path;
|
||||
mod log_oob_arf;
|
||||
mod maildir_batch;
|
||||
mod maildir_batch_452;
|
||||
@@ -46,6 +45,7 @@ mod rebind;
|
||||
mod rebind_event_defined;
|
||||
mod rebind_event_missing;
|
||||
mod rebind_port;
|
||||
mod resolve_egress_path;
|
||||
mod retry_schedule;
|
||||
mod rewrite_server_response;
|
||||
mod source_health;
|
||||
|
||||
@@ -11,11 +11,11 @@ mod bounce_list;
|
||||
mod inspect_message;
|
||||
mod inspect_ready_q;
|
||||
mod inspect_sched_q;
|
||||
mod resolve_egress_path;
|
||||
mod logfilter;
|
||||
mod provider_summary;
|
||||
mod queue_summary;
|
||||
mod rebind;
|
||||
mod resolve_egress_path;
|
||||
mod spool_compact;
|
||||
mod suspend;
|
||||
mod suspend_cancel;
|
||||
|
||||
@@ -60,7 +60,11 @@ impl ResolveEgressPathCommand {
|
||||
|
||||
let mut out = std::io::stdout().lock();
|
||||
if self.config {
|
||||
write!(out, "{}", mod_serde::toml_encode_pretty_compact(&response.path_config)?)?;
|
||||
write!(
|
||||
out,
|
||||
"{}",
|
||||
mod_serde::toml_encode_pretty_compact(&response.path_config)?
|
||||
)?;
|
||||
return Ok(());
|
||||
}
|
||||
if self.constraints {
|
||||
@@ -73,10 +77,7 @@ impl ResolveEgressPathCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn render_default(
|
||||
r: &ResolveEgressPathV1Response,
|
||||
out: &mut dyn Write,
|
||||
) -> anyhow::Result<()> {
|
||||
fn render_default(r: &ResolveEgressPathV1Response, out: &mut dyn Write) -> anyhow::Result<()> {
|
||||
writeln!(out, "domain: {}", r.domain)?;
|
||||
writeln!(out, "source: {}", r.source)?;
|
||||
writeln!(out, "queue: {}", r.queue_name)?;
|
||||
@@ -90,7 +91,11 @@ fn render_default(
|
||||
writeln!(out)?;
|
||||
writeln!(out, "--- egress path config ---")?;
|
||||
writeln!(out)?;
|
||||
writeln!(out, "{}", mod_serde::toml_encode_pretty_compact(&r.path_config)?)?;
|
||||
writeln!(
|
||||
out,
|
||||
"{}",
|
||||
mod_serde::toml_encode_pretty_compact(&r.path_config)?
|
||||
)?;
|
||||
|
||||
writeln!(out, "--- effective ceilings ---")?;
|
||||
writeln!(out)?;
|
||||
|
||||
@@ -849,7 +849,10 @@ impl EffectiveConstraints {
|
||||
.map(|c| c.display.clone())
|
||||
.or_else(|| self.max_message_rate_declared.clone());
|
||||
|
||||
merge_axis(&mut self.max_concurrent_dispatchers, &other.max_concurrent_dispatchers);
|
||||
merge_axis(
|
||||
&mut self.max_concurrent_dispatchers,
|
||||
&other.max_concurrent_dispatchers,
|
||||
);
|
||||
merge_optional(&mut self.max_message_rate, &other.max_message_rate);
|
||||
merge_optional(&mut self.max_connection_rate, &other.max_connection_rate);
|
||||
merge_optional(
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use crate::queue::Queue;
|
||||
use crate::ready_queue::{ReadyQueueManager, GET_EGRESS_PATH_CONFIG_SIG};
|
||||
use axum::extract::{Json, Query};
|
||||
use kumo_api_types::egress_path::{
|
||||
EgressPathConfig, EffectiveConstraints, MxResolution,
|
||||
};
|
||||
use kumo_api_types::egress_path::{EffectiveConstraints, EgressPathConfig, MxResolution};
|
||||
use kumo_api_types::{ResolveEgressPathV1Request, ResolveEgressPathV1Response};
|
||||
use serde_json::Value;
|
||||
use kumo_server_common::config_handle::ConfigHandle;
|
||||
use kumo_server_common::http_server::AppError;
|
||||
use serde_json::Value;
|
||||
|
||||
/// Resolve the effective egress path configuration and throughput
|
||||
/// ceilings for a destination domain and egress source.
|
||||
@@ -40,25 +38,29 @@ pub async fn resolve_v1(
|
||||
let queue_config_value: Value = serde_json::to_value(&queue_config)?;
|
||||
let queue_config = ConfigHandle::new(queue_config);
|
||||
|
||||
let (queue_name, site_name, mx) =
|
||||
match ReadyQueueManager::compute_queue_name(&request.domain, &queue_config, &source).await
|
||||
{
|
||||
Ok(ready_name) => {
|
||||
let mx = ready_name.mx.as_ref().map(|m| MxResolution::from(&**m));
|
||||
(ready_name.name, ready_name.site_name, mx)
|
||||
}
|
||||
Err(_) => {
|
||||
// DNS resolution failed (or wasn't applicable). Fall
|
||||
// back to using `domain` as the site name so we can
|
||||
// still synthesize a queue name and look up the path
|
||||
// config, matching the behavior of
|
||||
// resolve-shaping-domain.
|
||||
let site_name = request.domain.clone();
|
||||
let proto_part = queue_config.borrow().protocol.ready_queue_name();
|
||||
let queue_name = format!("{source}->{site_name}@{proto_part}");
|
||||
(queue_name, site_name, None)
|
||||
}
|
||||
};
|
||||
let (queue_name, site_name, mx) = match ReadyQueueManager::compute_queue_name(
|
||||
&request.domain,
|
||||
&queue_config,
|
||||
&source,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(ready_name) => {
|
||||
let mx = ready_name.mx.as_ref().map(|m| MxResolution::from(&**m));
|
||||
(ready_name.name, ready_name.site_name, mx)
|
||||
}
|
||||
Err(_) => {
|
||||
// DNS resolution failed (or wasn't applicable). Fall
|
||||
// back to using `domain` as the site name so we can
|
||||
// still synthesize a queue name and look up the path
|
||||
// config, matching the behavior of
|
||||
// resolve-shaping-domain.
|
||||
let site_name = request.domain.clone();
|
||||
let proto_part = queue_config.borrow().protocol.ready_queue_name();
|
||||
let queue_name = format!("{source}->{site_name}@{proto_part}");
|
||||
(queue_name, site_name, None)
|
||||
}
|
||||
};
|
||||
|
||||
let path_config: EgressPathConfig = config
|
||||
.async_call_callback(
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::smtp_server::{
|
||||
};
|
||||
use anyhow::Context;
|
||||
use config::{any_err, from_lua_value, get_or_create_module, SerdeWrappedValue};
|
||||
use kumo_api_types::egress_path::{EgressPathConfig, EffectiveConstraints};
|
||||
use kumo_api_types::egress_path::{EffectiveConstraints, EgressPathConfig};
|
||||
use kumo_log_types::rfc3464::ReportGenerationParams;
|
||||
use kumo_log_types::JsonLogRecord;
|
||||
use kumo_server_common::http_server::HttpListenerParams;
|
||||
|
||||
Reference in New Issue
Block a user