Merge upstream v0.16.23
Five conflicts, resolved: - crates/common/src/auth/authentication.rs: upstream's get_directory_for_token and JwtClaims replace extract_jwt_domain; the per-domain directory code (DIR-1, DIR-5 to DIR-7) is kept, and the token lookup routes through it. The release's one new Enterprise snippet was the body of get_directory_for_issuer, which stays returning None: a token naming no address gets the server default, as DIR-2 specifies and as v0.16.22 did. - crates/common/src/manager/application.rs: upstream's rewrite of the tests, with the temp directory names renamed again, and the 5(a) notice the name-purge change should have added. - crates/common/src/network/mta.rs: both sides' imports. - crates/main/Cargo.toml: the AGPL-only license kept, version 0.16.23. - Cargo.lock: upstream's, with the fork's crates added by Cargo.
This commit is contained in:
@@ -390,6 +390,16 @@ impl<T: SessionStream> SessionData<T> {
|
||||
.await
|
||||
.imap_ctx(&arguments.tag, trc::location!())?;
|
||||
let mut dest_cache = None;
|
||||
let train_spam = if dest_mailbox_id == JUNK_ID {
|
||||
Some(true)
|
||||
} else if src_mailbox.id.mailbox_id == JUNK_ID && dest_mailbox_id != TRASH_ID {
|
||||
Some(false)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let mut train_batch = BatchBuilder::new();
|
||||
let mut did_train = false;
|
||||
train_batch.with_account_id(src_account_id);
|
||||
for (id, imap_id) in ids {
|
||||
match self
|
||||
.server
|
||||
@@ -515,11 +525,33 @@ impl<T: SessionStream> SessionData<T> {
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(is_spam) = train_spam {
|
||||
self.server
|
||||
.add_account_spam_sample(
|
||||
&mut train_batch,
|
||||
src_account_id,
|
||||
id,
|
||||
is_spam,
|
||||
self.session_id,
|
||||
)
|
||||
.await
|
||||
.imap_ctx(&arguments.tag, trc::location!())?;
|
||||
train_batch.commit_point();
|
||||
did_train = true;
|
||||
}
|
||||
|
||||
if is_move {
|
||||
destroy_ids.insert(id);
|
||||
}
|
||||
}
|
||||
|
||||
if did_train {
|
||||
self.server
|
||||
.commit_batch(train_batch)
|
||||
.await
|
||||
.imap_ctx(&arguments.tag, trc::location!())?;
|
||||
}
|
||||
|
||||
// Untag or delete emails
|
||||
if !destroy_ids.is_empty() {
|
||||
let mut batch = BatchBuilder::new();
|
||||
|
||||
Reference in New Issue
Block a user