summaryrefslogtreecommitdiff
path: root/email.nix
diff options
context:
space:
mode:
Diffstat (limited to 'email.nix')
-rw-r--r--email.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/email.nix b/email.nix
new file mode 100644
index 0000000..ad2f7d4
--- /dev/null
+++ b/email.nix
@@ -0,0 +1,81 @@
+{ pkgs, ... }:
+
+let
+ homedir = builtins.getEnv "HOME";
+in
+{
+ accounts = {
+ email = {
+ maildirBasePath = "${homedir}/Mail";
+ accounts = {
+ "ben@bsima.me" = {
+ primary = true;
+ realName = "Ben Sima";
+ address = "ben@bsima.me";
+ folders = {
+ inbox = "INBOX";
+ };
+ imap = {
+ host = "mail.bsima.me";
+ port = 993;
+ };
+ smtp = {
+ host = "mail.bsima.me";
+ port = 587;
+ };
+ userName = "ben@bsima.me";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "none";
+ };
+ notmuch.enable = true;
+ msmtp.enable = false;
+ passwordCommand = "pass bnet/helium/mail/ben";
+ };
+ };
+ };
+ };
+
+ programs = {
+ notmuch = {
+ enable = true;
+ new.tags = [ "unread" "inbox" ];
+ hooks = {
+ preNew = ''
+ msmtp-queue -r
+ mbsync --all
+ '';
+ postNew = ''
+ notmuch tag -inbox +haskell -- to:haskell-cafe@haskell.org
+ notmuch tag -inbox +clojure -- to:clojure@googlegroups.com
+ notmuch tag -inbox +ai -- to:scikit-learn@python.org OR to:tensorflow.org
+ notmuch tag -inbox +bitcoin -- to:bitcoin-dev@lists.linuxfoundation.org OR to:bitcoin-discuss@lists.linuxfoundation.org
+ notmuch tag -inbox +diybio -- to:diybio@googlegroups.com
+ notmuch tag -inbox +meetups -- from:meetup.com
+ afew -tn
+ '';
+
+ };
+ extraConfig = {
+ search = {
+ exclude_tags = "deleted;spam;";
+ };
+ };
+ };
+
+ afew = {
+ enable = true;
+ extraConfig = builtins.readFile ./afew.ini;
+ };
+
+ mbsync = {
+ enable = true;
+ };
+
+ msmtp = {
+ enable = false;
+ extraConfig = builtins.readFile ./msmtprc;
+ };
+ };
+}