Key/value store access from Sieve scripts

This commit is contained in:
mdecimus
2023-12-12 15:28:21 +01:00
parent 78f932990d
commit 4301ec16d0
46 changed files with 1087 additions and 592 deletions

View File

@@ -50,6 +50,14 @@ async fn main() -> std::io::Result<()> {
let directory = config
.parse_directory(&stores)
.failed("Invalid configuration");
let schedulers = config
.parse_purge_schedules(
&stores,
config.value("jmap.store.data"),
config.value("jmap.store.blob"),
)
.await
.failed("Invalid configuration");
// Bind ports and drop privileges
servers.bind(&config);
@@ -77,7 +85,7 @@ async fn main() -> std::io::Result<()> {
.failed("Invalid configuration file");
// Spawn servers
let (shutdown_tx, _shutdown_rx) = servers.spawn(|server, shutdown_rx| {
let (shutdown_tx, shutdown_rx) = servers.spawn(|server, shutdown_rx| {
match &server.protocol {
ServerProtocol::Smtp | ServerProtocol::Lmtp => {
server.spawn(SmtpSessionManager::new(smtp.clone()), shutdown_rx)
@@ -99,6 +107,11 @@ async fn main() -> std::io::Result<()> {
};
});
// Spawn purge schedulers
for scheduler in schedulers {
scheduler.spawn(shutdown_rx.clone());
}
// Wait for shutdown signal
wait_for_shutdown(&format!(
"Shutting down Stalwart Mail Server v{}...",