{
pkgs,
hostname,
...
}: {
home.packages = with pkgs; [protonmail-bridge-gui];
accounts.email = {
maildirBasePath = "Mail";
accounts = let
realName = "Evie Litherland-Smith";
in {
proton = let
host = "127.0.0.1";
tls.enable = false;
in rec {
inherit realName;
primary = true;
maildir.path = "Proton";
imap = {
inherit host tls;
port = 1143;
};
smtp = {
port = 1025;
address = "e.litherlandsmith@proton.me";
aliases = ["evie@xenia.me.uk" "evie@litherlandsmith.slmail.me"];
userName = address;
passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostname}/proton | head -n1";
mu.enable = true;
msmtp = {
enable = true;
extraConfig = {
tls = "off";
auth = "login";
mbsync = {
create = "both";
expunge = "both";
remove = "both";
patterns = ["*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages"];
subFolders = "Verbatim";
extraConfig.account.AuthMechs = "LOGIN";
icloud = rec {
primary = false;
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 mbsync/${hostname}/icloud | head -n1";
msmtp.enable = true;
patterns = ["*" "!Notes"];
programs = {
groups.inboxes = {
proton = ["INBOX"];
icloud = ["INBOX"];
}