From 0a5754541bb01e96021ca7ee74f1256a8ee68bc4 Mon Sep 17 00:00:00 2001 From: tdback Date: Sat, 21 Dec 2024 15:32:13 -0500 Subject: initial commit to self-hosted git --- users/tdback/modules/email/default.nix | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 users/tdback/modules/email/default.nix (limited to 'users/tdback/modules/email/default.nix') diff --git a/users/tdback/modules/email/default.nix b/users/tdback/modules/email/default.nix new file mode 100644 index 0000000..3321462 --- /dev/null +++ b/users/tdback/modules/email/default.nix @@ -0,0 +1,78 @@ +{ pkgs, ... }: +{ + accounts.email = { + maildirBasePath = "mail"; + + accounts.fastmail = { + primary = true; + address = "tyler@tdback.net"; + userName = "tyler@tdback.net"; + realName = "Tyler Dunneback"; + passwordCommand = "${pkgs.age}/bin/age -d -i ~/.ssh/mail ~/.mail.age"; + + folders = { + inbox = "Inbox"; + drafts = "Drafts"; + sent = "Sent"; + trash = "Trash"; + }; + + imap = { + host = "imap.fastmail.com"; + port = 993; + tls = { + enable = true; + certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; + }; + }; + + smtp = { + host = "smtp.fastmail.com"; + port = 465; + tls = { + enable = true; + useStartTls = false; + certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; + }; + }; + + mbsync = { + enable = true; + create = "both"; + expunge = "none"; + subFolders = "Verbatim"; + patterns = [ "*" ]; + }; + + msmtp = { + enable = true; + extraConfig = { + logfile = "~/.cache/msmtp/msmtp.log"; + }; + }; + + neomutt = { + enable = true; + sendMailCommand = "msmtp"; + mailboxType = "maildir"; + extraMailboxes = [ + "Drafts" + "Sent" + "Trash" + "Archive" + ]; + }; + }; + }; + + programs = { + mbsync.enable = true; + msmtp.enable = true; + }; + + services.mbsync = { + enable = true; + package = pkgs.isync; + frequency = "*:0/5"; + }; +} -- cgit v1.2.3