Mail : Expunge old mail.

This commit is contained in:
Dmitry Voronin 2024-08-31 19:15:32 +03:00
parent 82407d5c30
commit 2ea6a04b6d
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 73 additions and 52 deletions

View file

@ -32,7 +32,7 @@ in {
services.cloudflare-dyndns = {
enable = true;
apiTokenFile = "/data/token";
deleteMissing = true;
deleteMissing = false;
ipv4 = true;
ipv6 = false;
proxied = false;
@ -46,10 +46,6 @@ in {
"paste"
"play"
"vpn"
"fmp-git"
"fmp-cloud"
"fmp-dev"
"fmp-master"
];
};
};

View file

@ -144,7 +144,7 @@ in {
Junk = {
auto = "subscribe";
specialUse = "Junk";
autoexpunge = "7d";
# autoexpunge = "3d";
};
Sent = {
auto = "subscribe";
@ -153,7 +153,7 @@ in {
Trash = {
auto = "subscribe";
specialUse = "Trash";
autoexpunge = "30d";
# autoexpunge = "30d";
};
};
@ -170,7 +170,8 @@ in {
# };
};
services.roundcube = {
services = {
roundcube = {
enable = true;
dicts = with pkgs.aspellDicts; [ en ru ];
hostName = cfg.domain;
@ -191,13 +192,35 @@ in {
'';
};
services.nginx = {
nginx = {
virtualHosts.${cfg.domain} = {
forceSSL = false;
enableACME = false;
};
};
};
systemd = {
services.autoexpunge = {
description = "Delete old mail";
serviceConfig.Type = "oneshot";
path = [ pkgs.dovecot ];
script = ''
doveadm expunge -A mailbox Junk SENTBEFORE 7d
doveadm expunge -A mailbox Trash SENTBEFORE 30d
'';
};
timers.autoexpunge = {
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "autoexpunge.service";
};
wantedBy = [ "timers.target" ];
};
};
};
};
};
}

View file

@ -23,8 +23,9 @@ in {
variables.OLLAMA_MODEL = cfg.primaryModel;
};
systemd.services = {
# Enable Ollama server.
systemd.services.ollama = {
ollama = {
description = "Ollama LLM server.";
wantedBy = [ "multi-user.target" ];
wants = [ "NetworkManager-wait-online.service" ];
@ -36,7 +37,7 @@ in {
};
# Download Ollama models.
systemd.services.ollamamodel = {
ollamamodel = {
description = "Ollama LLM model.";
wantedBy = [ "multi-user.target" ];
wants = [ "ollama.service" ];
@ -48,4 +49,5 @@ in {
'';
};
};
};
}