mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +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
|
context
|
||||||
.set_config(Config::AuthservidCandidates, Some(&new_config))
|
.set_config(Config::AuthservidCandidates, Some(&new_config))
|
||||||
.await?;
|
.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -235,6 +239,14 @@ async fn set_dkim_works(context: &Context, from_domain: &str) -> Result<()> {
|
|||||||
Ok(())
|
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> {
|
fn parse_authservid_candidates_config(config: &Option<String>) -> HashSet<&str> {
|
||||||
config
|
config
|
||||||
.as_deref()
|
.as_deref()
|
||||||
|
|||||||
Reference in New Issue
Block a user