mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Clear the dkim_works data when authservid candidates change
This commit is contained in:
@@ -156,6 +156,10 @@ async fn update_authservid_candidates(
|
||||
context
|
||||
.set_config(Config::AuthservidCandidates, Some(&new_config))
|
||||
.await?;
|
||||
// Updating the authservid candidates may mean that we now consider
|
||||
// emails as "failed" which "passed" previously, so we need to
|
||||
// reset our expectation which DKIMs work.
|
||||
clear_dkim_works(context).await?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -235,6 +239,14 @@ async fn set_dkim_works(context: &Context, from_domain: &str) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn clear_dkim_works(context: &Context) -> Result<()> {
|
||||
context
|
||||
.sql
|
||||
.execute("DELETE FROM sending_domains", paramsv![])
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn parse_authservid_candidates_config(config: &Option<String>) -> HashSet<&str> {
|
||||
config
|
||||
.as_deref()
|
||||
|
||||
Reference in New Issue
Block a user