Merge pull request 'Merge upstream v0.16.25' (#155) from merge/upstream-v0.16.25 into main
This commit was merged in pull request #155.
This commit is contained in:
commit
b64f6690f6
60 files changed
+1593
-490
No files matched your search
@@ -2,6 +2,8 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
use crate::utils::{jmap::JmapUtils, server::TestServer};
|
||||
@@ -11,8 +13,8 @@ use registry::{
|
||||
enums::{Permission, TaskSpamFilterMaintenanceType, TaskStoreMaintenanceType},
|
||||
prelude::{ObjectType, Property},
|
||||
structs::{
|
||||
Permissions, PermissionsList, SpamTrainingSample, Task, TaskSpamFilterMaintenance,
|
||||
TaskStatus, TaskStoreMaintenance,
|
||||
Jmap, Permissions, PermissionsList, SpamTrainingSample, Task,
|
||||
TaskSpamFilterMaintenance, TaskStatus, TaskStoreMaintenance,
|
||||
},
|
||||
},
|
||||
types::map::Map,
|
||||
@@ -26,6 +28,21 @@ pub async fn test(test: &mut TestServer) {
|
||||
|
||||
// Create test accounts
|
||||
let admin = test.account("[email protected]");
|
||||
|
||||
// inbuxa: the quota test leaves uploads expiring after one second, at
|
||||
// most three at a time. This test imports twenty samples, and a debug
|
||||
// build can take longer than that between upload and import.
|
||||
admin
|
||||
.registry_update_setting(
|
||||
Jmap::default(),
|
||||
&[
|
||||
Property::UploadQuota,
|
||||
Property::MaxUploadCount,
|
||||
Property::UploadTtl,
|
||||
],
|
||||
)
|
||||
.await;
|
||||
admin.reload_settings().await;
|
||||
let account = test
|
||||
.create_user_account(
|
||||
"[email protected]",
|
||||
@@ -209,6 +226,14 @@ pub async fn test(test: &mut TestServer) {
|
||||
assert_eq!(samples.iter().filter(|x| x.1.is_spam).count(), 11);
|
||||
assert_eq!(samples.len(), 20);
|
||||
|
||||
// Removing the duplicate sample of a reclassified email should not remove the blob of the kept sample
|
||||
for (id, sample) in &samples {
|
||||
assert!(
|
||||
client.download(&sample.blob_id.to_string()).await.is_ok(),
|
||||
"blob of sample {id} is not accessible"
|
||||
);
|
||||
}
|
||||
|
||||
// Adding a training sample without permissions should fail
|
||||
assert_eq!(
|
||||
account
|
||||
|
||||
Reference in new issue
Block a user