{ pkgs, hostName, ... }: { accounts.email.accounts = let realName = "Evelyn Litherland-Smith"; in { proton = let host = "127.0.0.1"; tls.enable = false; in rec { inherit realName; maildir.path = "Proton"; imap = { inherit host tls; port = 1143; }; smtp = { inherit host tls; port = 1025; }; address = "e.litherlandsmith@proton.me"; aliases = [ "evie@xenia.me.uk" "evie@litherlandsmith.slmail.me" ]; passwordCommand = "${pkgs.pass}/bin/pass show Mail/Proton/${hostName}"; primary = true; userName = address; mbsync = { enable = true; create = "both"; expunge = "both"; subFolders = "Verbatim"; extraConfig.account.AuthMechs = "LOGIN"; }; msmtp = { enable = true; extraConfig = { tls = "off"; auth = "login"; }; }; notmuch.enable = true; astroid.enable = true; }; icloud = rec { inherit realName; maildir.path = "iCloud"; imap.host = "imap.mail.me.com"; smtp.host = "smtp.mail.me.com"; address = "e.litherlandsmith@icloud.com"; passwordCommand = "${pkgs.pass}/bin/pass show Mail/iCloud/mbsync"; userName = address; mbsync = { enable = true; create = "both"; expunge = "both"; subFolders = "Verbatim"; }; msmtp.enable = true; notmuch.enable = true; astroid.enable = true; }; ukaea = let host = "127.0.0.1"; tls.enable = false; in rec { inherit realName; maildir.path = "UKAEA"; imap = { inherit host tls; port = 1144; }; smtp = { inherit host tls; port = 1026; }; address = "evie.litherland-smith@ukaea.uk"; passwordCommand = "${pkgs.pass}/bin/pass show Mail/Outlook/ukaea"; userName = address; mbsync = { enable = true; create = "both"; expunge = "both"; subFolders = "Verbatim"; extraConfig.account.AuthMechs = "LOGIN"; }; msmtp = { enable = true; extraConfig = { tls = "off"; auth = "login"; }; }; notmuch.enable = true; astroid.enable = true; }; }; home.packages = with pkgs; [ protonmail-bridge davmail vdirsyncer ]; programs = { mbsync.enable = true; msmtp.enable = true; # vdirsyncer = { enable = true; }; notmuch = { enable = true; maildir.synchronizeFlags = true; new.ignore = [ ".nnmaildir" ]; }; afew.enable = true; astroid = { enable = true; pollScript = "mbsync -a"; externalEditor = "emacsclient -q -a 'emacs' -c %1"; }; }; xdg.configFile."vdirsyncer/config".text = import ./config/vdirsyncer.nix { inherit pkgs; }; }