A new method, inbuxa:Explanation/set, asks the node's local model for a short plain-words reading of one thing an administrator is looking at: a failed recipient in the queue, a Classify verdict, a log line or trace event, or one setting with its saved value. The server builds the prompt itself from stored data and the registry schema, never from text the console sends, and grounds SMTP replies in RFC 3463 and RFC 5321. What the model is never shown: secrets (including ones nested inside a setting, like an AI model's HTTP auth), raw protocol events, and the contents of any other event. A tag name that doesn't have a tag's shape is refused before a model is asked. Calls share the AI gate with spam classification, but mail always keeps its slot, and Explain has its own hourly count per account and its own on/off switch in inbuxa:AiLimits. The permission is sysAiExplain, superuser only; tenant administrators can't use it. The session carries an aiExplain flag so a console knows when to offer the button. An install whose roles were stored before the permission existed gets it added once, at start-up, to the roles that are administrators' alone, not the User role their defaults share with every account. An operator who removes it later isn't overruled. Tests: unit tests in inbuxa-features and jmap, and ai_explain_tests (run with --ignored) covering the acceptance tests and the upgrade.
91 lines
2.3 KiB
Rust
91 lines
2.3 KiB
Rust
/*
|
|
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
|
*
|
|
* Modified by Coffey Labs in 2026 for INBUXA.
|
|
*/
|
|
|
|
pub mod antispam;
|
|
pub mod authentication;
|
|
pub mod ai;
|
|
pub mod ai_calibration;
|
|
pub mod ai_explain;
|
|
pub mod authorization;
|
|
pub mod auto_reload; // inbuxa: registry writes apply at once
|
|
pub mod branding;
|
|
pub mod crypto;
|
|
pub mod delivery;
|
|
pub mod directory;
|
|
pub mod masked_email;
|
|
pub mod monitoring;
|
|
pub mod oidc;
|
|
pub mod purge;
|
|
pub mod quota;
|
|
pub mod reload; // inbuxa: reloads and build errors
|
|
pub mod security;
|
|
pub mod task;
|
|
pub mod tracer_reload; // inbuxa: tracers start over when their settings change
|
|
pub mod tenant;
|
|
pub mod undelete;
|
|
|
|
use crate::utils::server::TestServerBuilder;
|
|
use registry::schema::structs::{Expression, Imap, MtaStageAuth};
|
|
|
|
#[tokio::test(flavor = "multi_thread")]
|
|
pub async fn system_tests() {
|
|
let mut test = TestServerBuilder::new("system_tests")
|
|
.await
|
|
.with_default_listeners()
|
|
.await
|
|
.with_object(Imap {
|
|
allow_plain_text_auth: true,
|
|
..Default::default()
|
|
})
|
|
.await
|
|
.with_object(MtaStageAuth {
|
|
require: Expression {
|
|
else_: "false".to_string(),
|
|
..Default::default()
|
|
},
|
|
..Default::default()
|
|
})
|
|
.await
|
|
.build()
|
|
.await;
|
|
|
|
// Create admin account
|
|
let admin = test
|
|
.create_user_account(
|
|
"admin",
|
|
"[email protected]",
|
|
"these_pretzels_are_making_me_thirsty",
|
|
&[],
|
|
"Admin",
|
|
)
|
|
.await;
|
|
test.account("admin")
|
|
.assign_roles_to_account(admin.id(), &["user", "system"])
|
|
.await;
|
|
test.insert_account(admin);
|
|
|
|
directory::test(&test).await;
|
|
authentication::test(&test).await;
|
|
oidc::test(&mut test).await;
|
|
authorization::test(&mut test).await;
|
|
tenant::test(&mut test).await;
|
|
masked_email::test(&mut test).await;
|
|
security::test(&mut test).await;
|
|
quota::test(&mut test).await;
|
|
purge::test(&mut test).await;
|
|
delivery::test(&mut test).await;
|
|
crypto::test(&mut test).await;
|
|
antispam::test(&mut test).await;
|
|
undelete::test(&mut test).await;
|
|
task::test(&mut test).await;
|
|
|
|
if test.is_reset() {
|
|
test.temp_dir.delete();
|
|
}
|
|
}
|