nixos/home/email/default.nix
Evie Litherland-Smith 6aae3e131f Fix accidentally disabling work email on work machines...
Move work email config to separate work.nix file in email directory,
remove the if block dependencies on mu status since that doesn't get
update if mu.enable is changed in another file!
2024-03-11 15:35:01 +00:00

82 lines
2 KiB
Nix

{
pkgs,
hostName,
...
}: {
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 = {
inherit host tls;
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 = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
patterns = ["*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages"];
subFolders = "Verbatim";
extraConfig.account.AuthMechs = "LOGIN";
};
};
icloud = rec {
inherit realName;
primary = false;
maildir.path = "iCloud";
imap.host = "imap.mail.me.com";
smtp.host = "smtp.mail.me.com";
address = "e.litherlandsmith@icloud.com";
userName = address;
passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostName}/icloud | head -n1";
mu.enable = true;
msmtp.enable = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
patterns = ["*" "!Notes"];
subFolders = "Verbatim";
};
};
};
};
programs = {
mu.enable = true;
msmtp.enable = true;
mbsync = {
enable = true;
groups.inboxes = {
proton = ["INBOX"];
icloud = ["INBOX"];
};
};
};
}