Import upstream v0.16.23, stripped
trivy / Check (pull_request) Canceled after 0s

Upstream commit: 9d1c75ab68435e4417337f768291e5f947686203
Enterprise-only files removed or emptied: 63
Enterprise-only snippets removed: 118 in 50 files
Dangling module declarations removed: 5
Edits turning enterprise off: 25
Third-party code: 14 files, 0 not in THIRD-PARTY.md
Verification: clean

One snippet more than v0.16.22, in crates/common/src/auth/authentication.rs
(3, was 2).
This commit is contained in:
2026-09-22 16:31:25 -07:00
parent 083474f67a
commit 3a272096c0
82 changed files with 1544 additions and 646 deletions
+123 -15
View File
@@ -587,14 +587,7 @@ END:VCARD
})
.await;
let bill_messages = test
.server
.get_cached_messages(bill.id().document_id())
.await
.unwrap()
.emails
.items
.len();
let bill_messages = inbox_count(&test.server, &bill).await;
lmtp.ingest(
"[email protected]",
@@ -612,17 +605,122 @@ END:VCARD
tokio::time::sleep(Duration::from_millis(200)).await;
assert_eq!(
test.server
.get_cached_messages(bill.id().document_id())
.await
.unwrap()
.emails
.items
.len(),
inbox_count(&test.server, &bill).await,
bill_messages + 1,
"sub-addressed mailing list member was not delivered"
);
// Lists nested within lists must be expanded recursively
admin
.registry_create_object(MailingList {
name: "engineering".to_string(),
recipients: Map::new(vec!["[email protected]".to_string()]),
domain_id,
..Default::default()
})
.await;
admin
.registry_create_object(MailingList {
name: "all-staff".to_string(),
recipients: Map::new(vec![
"[email protected]".to_string(),
"[email protected]".to_string(),
]),
domain_id,
..Default::default()
})
.await;
let jane_messages = inbox_count(&test.server, &jane).await;
let bill_messages = inbox_count(&test.server, &bill).await;
lmtp.ingest(
"[email protected]",
&["[email protected]"],
concat!(
"From: [email protected]\r\n",
"To: [email protected]\r\n",
"Subject: Company picnic\r\n",
"\r\n",
"Bring your own stapler."
),
)
.await;
tokio::time::sleep(Duration::from_millis(200)).await;
assert_eq!(
inbox_count(&test.server, &jane).await,
jane_messages + 1,
"nested mailing list member was not delivered"
);
assert_eq!(
inbox_count(&test.server, &bill).await,
bill_messages + 1,
"direct mailing list member was not delivered"
);
// Lists that reference each other must terminate and deliver exactly once
admin
.registry_create_object(MailingList {
name: "ouroboros-head".to_string(),
recipients: Map::new(vec![
"[email protected]".to_string(),
"[email protected]".to_string(),
"[email protected]".to_string(),
]),
domain_id,
..Default::default()
})
.await;
admin
.registry_create_object(MailingList {
name: "ouroboros-tail".to_string(),
recipients: Map::new(vec![
"[email protected]".to_string(),
"[email protected]".to_string(),
"[email protected]".to_string(),
]),
domain_id,
..Default::default()
})
.await;
let john_messages = inbox_count(&test.server, &john).await;
let jane_messages = inbox_count(&test.server, &jane).await;
let bill_messages = inbox_count(&test.server, &bill).await;
lmtp.ingest(
"[email protected]",
&["[email protected]"],
concat!(
"From: [email protected]\r\n",
"To: [email protected]\r\n",
"Subject: Going in circles\r\n",
"\r\n",
"Please advise."
),
)
.await;
tokio::time::sleep(Duration::from_millis(200)).await;
assert_eq!(
inbox_count(&test.server, &john).await,
john_messages + 1,
"cyclic mailing list did not deliver exactly once"
);
assert_eq!(
inbox_count(&test.server, &jane).await,
jane_messages + 1,
"cyclic mailing list did not deliver exactly once"
);
assert_eq!(
inbox_count(&test.server, &bill).await,
bill_messages + 1,
"member shared by two nested lists was delivered more than once"
);
// Remove test data
john.registry_destroy(
ObjectType::MaskedEmail,
@@ -703,3 +801,13 @@ async fn message_metadata(server: &Server, account_id: u32, document_id: u32) ->
.deserialize::<MessageMetadata>()
.unwrap()
}
async fn inbox_count(server: &Server, account: &Account) -> usize {
server
.get_cached_messages(account.id().document_id())
.await
.unwrap()
.emails
.items
.len()
}