From c7d8366f6f46e64cece2f4998874737ed15d5df9 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Fri, 10 Sep 2021 21:34:42 +0200 Subject: [PATCH] add mail servers --- configs/sterni/packages.nix | 1 + configs/workhorse/mail-fetcher.nix | 37 ++++++++++++++++++++++++++++-- system/desktop/mail-stuff.nix | 19 +++++++++++++-- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/configs/sterni/packages.nix b/configs/sterni/packages.nix index 71893fd..fdae209 100644 --- a/configs/sterni/packages.nix +++ b/configs/sterni/packages.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: let unstable = import { }; + nextcloudSync = folder: pkgs.writers.writeBashBin "nextcloud-sync-${folder}" '' ${pkgs.nextcloud-client}/bin/nextcloudcmd \ diff --git a/configs/workhorse/mail-fetcher.nix b/configs/workhorse/mail-fetcher.nix index 8cac3d0..009dcc0 100644 --- a/configs/workhorse/mail-fetcher.nix +++ b/configs/workhorse/mail-fetcher.nix @@ -16,6 +16,7 @@ let "from:getdigital.de" "from:getpocket.com" "from:ghostinspector.com" + "from:globetrotter.de" "from:hackster.io" "from:hostelworld.com" "from:immobilienscout24.de" @@ -387,6 +388,7 @@ let ((lib.imap0 junk_template junk_filter) ++ (lib.imap0 template filters))); notmuchTaggingNew = let + template = index: { tags, query, message ? "generic", ... }: let @@ -399,8 +401,15 @@ let echo '${command}' ${command} ''; - in pkgs.writers.writeBash "notmuch-tagging-new" - (lib.concatStringsSep "\n" (lib.imap0 template filters)); + + junk_template = index: query: + template index { + tags = [ "+junk" "-unread" "-inbox" ]; + query = query; + message = "generic junk filter"; + }; + in pkgs.writers.writeBash "notmuch-tagging-new" (lib.concatStringsSep "\n" + ((lib.imap0 junk_template junk_filter) ++ (lib.imap0 template filters))); in { @@ -418,6 +427,11 @@ in { # configure passwords krops.userKeys = { + "namecheap.terranix.org" = { + user = config.users.users.mailUser.name; + source = toString ; + requiredBy = [ "fetchmail.service" ]; + }; "gmail.palipalo9" = { user = config.users.users.mailUser.name; source = toString ; @@ -584,6 +598,25 @@ in { }; notmuch.enable = true; }; + terranix_org = { + # for google accounts you have to allow 'less secure apps' in accounts.google.com + primary = true; + address = "palo@terranix.org"; + aliases = [ ]; + realName = "Ingolf Wagner"; + userName = "palo@terranix.org"; + passwordCommand = + "cat ${toString config.krops.userKeys."namecheap.terranix.org".target}"; + imap = { + host = "mail.privateemail.com"; + port = 993; + }; + mbsync = { + enable = true; + create = "both"; + }; + notmuch.enable = true; + }; ingolf-wagner-de = { primary = false; address = "contact@ingolf-wagner.de"; diff --git a/system/desktop/mail-stuff.nix b/system/desktop/mail-stuff.nix index 369b0f9..701114b 100644 --- a/system/desktop/mail-stuff.nix +++ b/system/desktop/mail-stuff.nix @@ -66,6 +66,23 @@ in { # tls.fingerprint = "3F:B7:F9:7A:AC:9C:D7:C4:2E:8A:C1:F9:90:B5:D7:D1:8E:E2:F7:7D:9D:DB:FA:01:55:27:D2:79:5F:F8:C1:64"; }; }; + terranix_org = { + primary = false; + address = "palo@terranix.org"; + aliases = [ ]; + realName = "Ingolf Wagner"; + userName = "palo@terranix.org"; + passwordCommand = passcmd "mail/namecheap/palo@terranix.org"; + smtp = { + host = "mail.privateemail.com"; + port = 465; + }; + notmuch.enable = true; + msmtp = { + enable = true; + # msmtp --serverinfo --tls --tls-certcheck=off -a gmail + }; + }; gmail = { # for google accounts you have to allow 'less secure apps' in accounts.google.com primary = true; @@ -82,8 +99,6 @@ in { msmtp = { enable = true; # msmtp --serverinfo --tls --tls-certcheck=off -a gmail - # tls.fingerprint = "77:2F:E1:F0:1C:9C:00:45:36:D5:0B:25:17:76:AC:7F:0E:79:68:27:8C:E9:E1:F6:BD:DF:F1:6F:1E:8C:85:18"; - # tls.fingerprint = "3F:B7:F9:7A:AC:9C:D7:C4:2E:8A:C1:F9:90:B5:D7:D1:8E:E2:F7:7D:9D:DB:FA:01:55:27:D2:79:5F:F8:C1:64"; }; gpg = { encryptByDefault = true;