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

View file

@ -144,7 +144,7 @@ in {
Junk = { Junk = {
auto = "subscribe"; auto = "subscribe";
specialUse = "Junk"; specialUse = "Junk";
autoexpunge = "7d"; # autoexpunge = "3d";
}; };
Sent = { Sent = {
auto = "subscribe"; auto = "subscribe";
@ -153,7 +153,7 @@ in {
Trash = { Trash = {
auto = "subscribe"; auto = "subscribe";
specialUse = "Trash"; specialUse = "Trash";
autoexpunge = "30d"; # autoexpunge = "30d";
}; };
}; };
@ -170,7 +170,8 @@ in {
# }; # };
}; };
services.roundcube = { services = {
roundcube = {
enable = true; enable = true;
dicts = with pkgs.aspellDicts; [ en ru ]; dicts = with pkgs.aspellDicts; [ en ru ];
hostName = cfg.domain; hostName = cfg.domain;
@ -191,13 +192,35 @@ in {
''; '';
}; };
services.nginx = { nginx = {
virtualHosts.${cfg.domain} = { virtualHosts.${cfg.domain} = {
forceSSL = false; forceSSL = false;
enableACME = 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; variables.OLLAMA_MODEL = cfg.primaryModel;
}; };
systemd.services = {
# Enable Ollama server. # Enable Ollama server.
systemd.services.ollama = { ollama = {
description = "Ollama LLM server."; description = "Ollama LLM server.";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
wants = [ "NetworkManager-wait-online.service" ]; wants = [ "NetworkManager-wait-online.service" ];
@ -36,7 +37,7 @@ in {
}; };
# Download Ollama models. # Download Ollama models.
systemd.services.ollamamodel = { ollamamodel = {
description = "Ollama LLM model."; description = "Ollama LLM model.";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
wants = [ "ollama.service" ]; wants = [ "ollama.service" ];
@ -48,4 +49,5 @@ in {
''; '';
}; };
}; };
};
} }