From ba0b64b6b71f79d17e3c528cbe40fd4043c10f7a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 23 Apr 2022 15:39:35 -0400 Subject: [PATCH] email: use protonmail --- home/email.nix | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/home/email.nix b/home/email.nix index 2560d15..450a472 100644 --- a/home/email.nix +++ b/home/email.nix @@ -1,17 +1,9 @@ { pkgs, ... }: -{ - programs.himalaya = { - enable = true; - settings = {}; - }; - accounts.email.accounts = { +let + realName = "Sridhar Ratnakumar"; + # IMAP/SMTP settings for standard email servers + servers = { icloud = { - primary = true; - himalaya.enable = true; - address = "srid@srid.ca"; - realName = "Sridhar Ratnakumar"; - userName = "happyandharmless"; - passwordCommand = "op item get iCloud --fields label=himalaya"; imap = { host = "imap.mail.me.com"; port = 993; @@ -23,6 +15,40 @@ tls.enable = true; }; }; + protonmail = { + imap = { + host = "127.0.0.1"; + port = 1143; + tls.enable = true; + tls.useStartTls = true; + }; + smtp = { + host = "127.0.0.1"; + port = 1025; + tls.enable = true; + }; + }; + }; +in { + programs.himalaya = { + enable = true; + settings = {}; + }; + accounts.email.accounts = { + proton = servers.protonmail // { + inherit realName; + primary = true; + himalaya.enable = true; + address = "srid@srid.ca"; + userName = "hey@srid.ca"; + passwordCommand = "cat /Users/srid/.protonmail.password"; # Local only, so I don't care + }; + icloud = servers.icloud // { + inherit realName; + address = "happyandharmless@icloud.com"; + userName = "happyandharmless"; + passwordCommand = "op item get iCloud --fields label=himalaya"; + }; }; }