enable spam training

This commit is contained in:
Rouven Seifert 2023-09-03 22:30:56 +02:00
parent 0fb1da3199
commit 9f90c1643a
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
4 changed files with 50 additions and 16 deletions

View file

@ -255,11 +255,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1693399033, "lastModified": 1693713564,
"narHash": "sha256-yXhiMo8MnE86sGtPIHAKaLHhmhe8v9tqGGotlUgKJvY=", "narHash": "sha256-00w2uwb4O6Y1e2W5LG5UFyl1ZN3KFG7aoRdYEvT/BqA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f5c15668f9842dd4d5430787d6aa8a28a07f7c10", "rev": "8e49b883890ccb52c059abb152b00a416342ec1c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -356,11 +356,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1693107069, "lastModified": 1693711723,
"narHash": "sha256-5dVXPchyvzmytanlwXHcmeQP9AfO/98Q6V+QtsMl5vQ=", "narHash": "sha256-5QmlVzskLciJ0QzYmZ6ULvKA7bP6pgV9wwrLBB0V3j0=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "53d40cf1bea235658ef8f6e8b8a1d033e2ecbfff", "rev": "aca56a79afb82208af2b39d8459dd29c10989135",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -371,11 +371,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1692952286, "lastModified": 1693718952,
"narHash": "sha256-TsrtPv3+Q1KR0avZxpiJH+b6fX/R/hEQVHbjl1ebotY=", "narHash": "sha256-+nGdJlgTk0MPN7NygopipmyylVuAVi7OItIwTlwtGnw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "817e297fc3352fadc15f2c5306909aa9192d7d97", "rev": "793de77d9f83418b428e8ba70d1e42c6507d0d35",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -448,11 +448,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1693377291, "lastModified": 1693663421,
"narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=", "narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e7f38be3775bab9659575f192ece011c033655f0", "rev": "e56990880811a451abd32515698c712788be5720",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -26,6 +26,22 @@ in
description = "Rouven Seifert"; description = "Rouven Seifert";
isNormalUser = true; isNormalUser = true;
}; };
environment.etc = {
"dovecot/sieve-pipe/sa-learn-spam.sh" = {
text = ''
#!/bin/sh
${pkgs.rspamd}/bin/rspamc learn_spam
'';
mode = "0555";
};
"dovecot/sieve-pipe/sa-learn-ham.sh" = {
text = ''
#!/bin/sh
${pkgs.rspamd}/bin/rspamc learn_ham
'';
mode = "0555";
};
};
services = { services = {
postfix = { postfix = {
@ -95,7 +111,7 @@ in
mailPlugins = { mailPlugins = {
perProtocol = { perProtocol = {
imap = { imap = {
enable = [ ]; enable = [ "imap_sieve" ];
}; };
lmtp = { lmtp = {
enable = [ "sieve" ]; enable = [ "sieve" ];
@ -151,6 +167,23 @@ in
} }
client_limit = 1 client_limit = 1
} }
plugin {
sieve_plugins = sieve_imapsieve sieve_extprograms
sieve_global_extensions = +vnd.dovecot.pipe
sieve_pipe_bin_dir = /etc/dovecot/sieve-pipe
# Spam: From elsewhere to Spam folder or flag changed in Spam folder
imapsieve_mailbox1_name = Spam
imapsieve_mailbox1_causes = COPY APPEND FLAG
imapsieve_mailbox1_before = file:/var/lib/dovecot/imap_sieve/report-spam.sieve
# Ham: From Spam folder to elsewhere
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox1_before = file:/var/lib/dovecot/imap_sieve/report-ham.sieve
}
''; '';
}; };

View file

@ -71,6 +71,7 @@
programs.texlive.enable = true; programs.texlive.enable = true;
programs.obs-studio.enable = true; programs.obs-studio.enable = true;
programs.firefox.enable = true;
xdg.mimeApps = { xdg.mimeApps = {
enable = true; enable = true;

View file

@ -12,7 +12,7 @@
height = 26; height = 26;
# modules-left = [ "wlr/workspaces" "custom/spotifytitle" "hyprland/window" ]; # modules-left = [ "wlr/workspaces" "custom/spotifytitle" "hyprland/window" ];
modules-left = [ "river/tags" "custom/spotifytitle" "river/window" ]; modules-left = [ "river/tags" "custom/spotifytitle" "river/window" ];
modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "custom/notification" "clock" ]; modules-right = [ "network" "cpu" "pulseaudio" "battery" "tray" "custom/notification" "clock" ];
network = { network = {
format-wifi = " {essid} ({signalStrength}%)"; format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = "󰈀 {ipaddr}/{cidr}"; format-ethernet = "󰈀 {ipaddr}/{cidr}";
@ -192,12 +192,12 @@
} }
#cpu { #cpu {
background-color: #${config.colorScheme.colors.base06}; background-color: #${config.colorScheme.colors.base05};
color: #${config.colorScheme.colors.base01}; color: #${config.colorScheme.colors.base01};
} }
#network { #network {
background-color: #${config.colorScheme.colors.base07}; background-color: #${config.colorScheme.colors.base06};
color: #${config.colorScheme.colors.base01}; color: #${config.colorScheme.colors.base01};
} }