Commit 4a04d652d42d

Vincent Demeester <vincent@sbr.pm>
2020-03-13 16:53:30
Add prv account to smtp, and make it the primary 📎
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent d7ce6f6
Changed files (2)
modules
profiles
modules/profiles/mails.nix
@@ -53,7 +53,6 @@ accounts.email = {
       msmtp.enable = true;
     };
     "perso" = {
-      primary = true;
       address = "vinc.demeester@gmail.com";
       userName = "vinc.demeester@gmail.com";
       realName = "Vincent Demeester";
@@ -79,6 +78,33 @@ accounts.email = {
       astroid.enable = cfg.sync;
       msmtp.enable = true;
     };
+    "prv" = {
+      primary = true;
+      address = "vincent@demeester.fr";
+      userName = "vincent@demeester.fr";
+      realName = "Vincent Demeester";
+      passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg";
+      imap.host = "mail.gandi.net";
+      smtp.host = "mail.gandi.net";
+      mbsync = {
+        enable = true;
+        create = "both";
+        expunge = "both";
+        patterns = ["*"];
+        extraConfig = {
+          channel = {
+            Sync = "All";
+          };
+          account = {
+            Timeout = 120;
+            PipelineDepth = 1;
+          };
+        };
+      };
+      notmuch.enable = cfg.sync;
+      astroid.enable = cfg.sync;
+      msmtp.enable = true;
+    };
   };
 };
 
mails.org
@@ -122,7 +122,6 @@
       msmtp.enable = true;
     };
     "perso" = {
-      primary = true;
       address = "vinc.demeester@gmail.com";
       userName = "vinc.demeester@gmail.com";
       realName = "Vincent Demeester";
@@ -148,10 +147,50 @@
       astroid.enable = cfg.sync;
       msmtp.enable = true;
     };
+    "prv" = {
+      primary = true;
+      address = "vincent@demeester.fr";
+      userName = "vincent@demeester.fr";
+      realName = "Vincent Demeester";
+      passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg";
+      imap.host = "mail.gandi.net";
+      smtp.host = "mail.gandi.net";
+      mbsync = {
+        enable = true;
+        create = "both";
+        expunge = "both";
+        patterns = ["*"];
+        extraConfig = {
+          channel = {
+            Sync = "All";
+          };
+          account = {
+            Timeout = 120;
+            PipelineDepth = 1;
+          };
+        };
+      };
+      notmuch.enable = cfg.sync;
+      astroid.enable = cfg.sync;
+      msmtp.enable = true;
+    };
   };
 };
 #+end_src
 
+To create the pasword files:
+- create =~/desktop/documents/{account}.pass.gpg= file, you need to create a
+  =~/desktop/documents/prv.pass= file with the actual password.
+- create =~/sync/{account}.pass= with a passphrase (long, complex, whatever…)
+- encrypt =~/desktop/documents/{account}.pass.gpg= with the following command
+
+  #+begin_src bash
+  gpg --batch --yes --symmetric --passphrase-file ~/sync/{account}.pass --encrypt {account.pass}
+  #+end_src
+
+- remove =~/desktop/documents/{account}.pass=
+
+
 ** ~msmtp~ wrapper
 :PROPERTIES:
 :CUSTOM_ID: h:cc9d0707-d775-49ef-884d-ae65174fb259