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

View file

@ -26,6 +26,22 @@ in
description = "Rouven Seifert";
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 = {
postfix = {
@ -95,7 +111,7 @@ in
mailPlugins = {
perProtocol = {
imap = {
enable = [ ];
enable = [ "imap_sieve" ];
};
lmtp = {
enable = [ "sieve" ];
@ -151,6 +167,23 @@ in
}
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.obs-studio.enable = true;
programs.firefox.enable = true;
xdg.mimeApps = {
enable = true;

View file

@ -12,7 +12,7 @@
height = 26;
# modules-left = [ "wlr/workspaces" "custom/spotifytitle" "hyprland/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 = {
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = "󰈀 {ipaddr}/{cidr}";
@ -192,12 +192,12 @@
}
#cpu {
background-color: #${config.colorScheme.colors.base06};
background-color: #${config.colorScheme.colors.base05};
color: #${config.colorScheme.colors.base01};
}
#network {
background-color: #${config.colorScheme.colors.base07};
background-color: #${config.colorScheme.colors.base06};
color: #${config.colorScheme.colors.base01};
}