Every way of deleting mail for good (JMAP, IMAP expunge, POP3, Trash emptying, mailbox removal) notes the message's mailboxes and keywords while archiving is on, fixing its deadline then; when its data is finally removed it becomes an x:ArchivedItem record, written as upstream writes them, with its copy held until the deadline. Retention is read at deletion time, so a change applies at once. Restore puts a message back in the mailboxes it was in (Trash only if that was all), with its keywords, and removes the record; over quota it stays archived. x:ArchivedItem/get returns status and accountId; query filters on type, archivedAt and text; set requests a restore once or destroys; /changes is a fork addition. Expired items go in the data purge. The shared account-access rule moves to jmap::inbuxa::access. system_tests now calls undelete::test, and the archiving gate is gone.
81 lines
2.0 KiB
Rust
81 lines
2.0 KiB
Rust
/*
|
|
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
|
*/
|
|
|
|
pub mod antispam;
|
|
pub mod authentication;
|
|
pub mod authorization;
|
|
pub mod crypto;
|
|
pub mod delivery;
|
|
pub mod directory;
|
|
pub mod masked_email;
|
|
pub mod oidc;
|
|
pub mod purge;
|
|
pub mod quota;
|
|
pub mod security;
|
|
pub mod task;
|
|
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();
|
|
}
|
|
}
|