Commit b2ebc8aed0cc

Vincent Demeester <vincent@sbr.pm>
2025-02-12 12:06:16
tools/emacs: updates on emails…
Sync almost everything *but* "All mails" for gmail.
1 parent 17b8965
Changed files (2)
tools
emacs
users
tools/emacs/config/config-mu4e.el
@@ -47,21 +47,34 @@
 				   (mu4e-trash-folder . "/icloud/Deleted Messages")
 				   (mu4e-sent-folder . "/icloud/Sent Messages")
 				   (mu4e-draft-folder . "/icloud/Drafts")
-				   ;; (mu4e-get-mail-command . "mbsync icloud")
+				   (mu4e-get-mail-command . "mbsync icloud")
+				   ))
+			 ,(make-mu4e-context
+			   :name "gmail"
+			   :match-func (lambda (msg) (when msg
+						       (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
+			   :vars '(
+				   (mu4e-drafts-folder  . "/gmail/[Gmail]/Drafts")
+				   (mu4e-sent-folder  . "/gmail/[Gmail]/Sent Mail")
+				   ;; (mu4e-refile-folder  . "/gmail/[Gmail]/All Mail")
+				   (mu4e-trash-folder  . "/gmail/[Gmail]/Trash")
+				   (mu4e-get-mail-command . "mbsync gmail")
+				   ))
+			 ,(make-mu4e-context
+			   :name "redhat"
+			   :match-func (lambda (msg) (when msg
+						       (string-prefix-p "/redhat" (mu4e-message-field msg :maildir))))
+			   :vars '(
+				   (mu4e-drafts-folder  . "/redhat/[Gmail]/Drafts")
+				   (mu4e-sent-folder  . "/redhat/[Gmail]/Sent Mail")
+				   ;; (mu4e-refile-folder  . "/redhat/[Gmail]/All Mail")
+				   (mu4e-trash-folder  . "/redhat/[Gmail]/Trash")
+				   (mu4e-get-mail-command . "mbsync redhat")
 				   ))
-			 ;; ,(make-mu4e-context
-			 ;;   :name "gmail"
-			 ;;   :match-func (lambda (msg) (when msg
-			 ;; 			       (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
-			 ;;   :vars '(
-			 ;; 	   (mu4e-trash-folder . "/Gmail/[Gmail].Trash")
-			 ;; 	   (mu4e-refile-folder . "/Gmail/[Gmail].Archive")
-			 ;; 	   (mu4e-get-mail-command . "mbsync gmail")
-			 ;; 	   ))
 			 ))
   (add-to-list 'mu4e-bookmarks
 	       '( :name  "All Inboxes"
-		  :query "maildir:/icloud/INBOX OR maildir:/gmail/INBOX"
+		  :query "maildir:/icloud/INBOX OR maildir:/gmail/INBOX OR maildir:/redhat/INBOX"
 		  :key   ?b))
   (with-eval-after-load "mm-decode"
     (add-to-list 'mm-discouraged-alternatives "text/html")
users/vincent/default.nix
@@ -154,15 +154,20 @@ in
                 imap.host = "imap.gmail.com";
                 smtp.host = "smtp.gmail.com";
                 flavor = "gmail.com";
-                aerc.enable = true;
-                msmtp.enable = true;
+                # aerc.enable = true;
+                msmtp = {
+                  enable = true;
+                  extraConfig = {
+                    tls_starttls = "on";
+                  };
+                };
                 # This is here for doing backup
                 mbsync = {
                   enable = true;
                   create = "both";
                   expunge = "both";
                   # Sync everything *but* "[Gmail] All Mail" to get the "organized" view.
-                  patterns = [ "*" "![Gmail]*" "[Gmail]Sent Mail" "[Gmail]Starred" "[Gmail]Trash" ];
+                  patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/Trash" "[Gmail]/Drafts" ];
                   extraConfig = {
                     channel = {
                       Sync = "All";
@@ -183,11 +188,30 @@ in
                 imap.host = "imap.gmail.com";
                 smtp.host = "smtp.gmail.com";
                 flavor = "gmail.com";
-                #lieer.enable = true;
-                # mu.enable = true;
-                #notmuch.enable = true;
-                aerc.enable = true;
-                msmtp.enable = true;
+                mbsync = {
+                  enable = true;
+                  create = "both";
+                  expunge = "both";
+                  # Sync everything *but* "[Gmail] All Mail" to get the "organized" view.
+                  patterns = [ "*" "!area/github" "!memo-list" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/Trash" "[Gmail]/Drafts" ];
+                  extraConfig = {
+                    channel = {
+                      Sync = "All";
+                    };
+                    account = {
+                      Timeout = 120;
+                      PipelineDepth = 1;
+                    };
+                  };
+                };
+                mu.enable = true;
+                # aerc.enable = true;
+                msmtp = {
+                  enable = true;
+                  extraConfig = {
+                    tls_starttls = "on";
+                  };
+                };
               };
             };
           };