* .emacs.d/lisp/bandali-gnus.el: Tweak gnus-posting-styles.
[~bandali/configs] / .emacs.d / lisp / bandali-gnus.el
index d8949ed..fa05a00 100644 (file)
@@ -91,6 +91,8 @@
             (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
             ;; fsf
             (list ".*<\\(.*\\)\\.fsf\\.org>.*" "l.\\1")
             (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
             ;; fsf
             (list ".*<\\(.*\\)\\.fsf\\.org>.*" "l.\\1")
+            ;; debian
+            (list ".*<\\(.*\\)\\.alioth-lists\\.debian\\.net>.*" "l.\\1")
             ;; gnus
             (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1")
             ;; libreplanet
             ;; gnus
             (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1")
             ;; libreplanet
             ;; ----------------------------------
             ;; otherwise, leave mail in INBOX
             "INBOX")))
             ;; ----------------------------------
             ;; otherwise, leave mail in INBOX
             "INBOX")))
-         (nnimap
-          "uwaterloo"
-          (nnimap-stream plain)
-          (nnimap-address "127.0.0.1")
-          (nnimap-server-port 143)
-          (nnimap-authenticator plain)
-          (nnimap-user "abandali@uwaterloo.local")
-          (nnimap-inbox "INBOX")
-          (nnimap-split-methods 'nnimap-split-fancy)
-          (nnimap-split-fancy
-           (|
-            ;; (: gnus-registry-split-fancy-with-parent)
-            ;; se212-f19
-            ("subject" "SE\\s-?212" "course.se212-f19")
-            (from "SE\\s-?212" "course.se212-f19")
-            ;; catch-all
-            "INBOX")))
          (nnimap
           "csc"
           (nnimap-stream plain)
          (nnimap
           "csc"
           (nnimap-stream plain)
             ("X-Spam-Flag" "YES" "Junk")
             ;; catch-all
             "INBOX")))
             ("X-Spam-Flag" "YES" "Junk")
             ;; catch-all
             "INBOX")))
-         ;; (nnimap
-         ;;  "sfl"
-         ;;  (nnimap-stream tls)
-         ;;  (nnimap-address "mail.savoirfairelinux.com")
-         ;;  (nnimap-user "amin.bandali"))
-         )))
+         (nnimap
+          "sfl"
+          (nnimap-stream plain)
+          (nnimap-address "127.0.0.1")
+          (nnimap-server-port 143)
+          (nnimap-authenticator plain)
+          (nnimap-user "amin.bandali@savoirfairelinux.local")))))
  gnus-message-archive-group "nnimap+gnu:INBOX"
  gnus-parameters
  '(("l\\.deepspec"
  gnus-message-archive-group "nnimap+gnu:INBOX"
  gnus-parameters
  '(("l\\.deepspec"
        '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
        t)))
 
        '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
        t)))
 
+  (setq gnus-user-agent '(emacs gnus type))
+
   ;; (require 'gnus-registry)
   ;; (setq gnus-registry-max-entries 2500)
   ;; (setq gnus-registry-ignored-groups
   ;; (require 'gnus-registry)
   ;; (setq gnus-registry-max-entries 2500)
   ;; (setq gnus-registry-ignored-groups
   (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number
                                      gnus-thread-sort-by-subject
                                      gnus-thread-sort-by-date))
   (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number
                                      gnus-thread-sort-by-subject
                                      gnus-thread-sort-by-date))
+  (with-eval-after-load 'message
+    (setq gnus-ignored-from-addresses message-dont-reply-to-names))
   ;; local key bindings
   (define-key gnus-summary-mode-map (kbd "M-L") #'org-store-link)
   ;; (define-key gnus-summary-mode-map (kbd "r")
   ;; local key bindings
   (define-key gnus-summary-mode-map (kbd "M-L") #'org-store-link)
   ;; (define-key gnus-summary-mode-map (kbd "r")
 (defvar b/sfl-p nil)
 (with-eval-after-load 'gnus-msg
   (let ((bandali "Amin Bandali (https://kelar.org/~bandali)"))
 (defvar b/sfl-p nil)
 (with-eval-after-load 'gnus-msg
   (let ((bandali "Amin Bandali (https://kelar.org/~bandali)"))
-    (defvar b/canonical-signature
-      (mapconcat
-       #'identity
-       `(,bandali
-         "Software Engineer (Desktop), Canonical")
-       "\n"))
     (defvar b/csc-signature
       (mapconcat
        #'identity
     (defvar b/csc-signature
       (mapconcat
        #'identity
       ("X-Message-SMTP-Method" "smtp mail.shemshak.org 587")
       (gcc "nnimap+shemshak:Sent"))
      ("nnimap\\+canonical:.*"
       ("X-Message-SMTP-Method" "smtp mail.shemshak.org 587")
       (gcc "nnimap+shemshak:Sent"))
      ("nnimap\\+canonical:.*"
-      (address "amin.bandali@canonical.com")
+      (address "bandali@canonical.com")
       ("X-Message-SMTP-Method" "smtp smtp.canonical.com 587")
       ("X-Message-SMTP-Method" "smtp smtp.canonical.com 587")
-      (signature b/canonical-signature)
+      (signature nil)
       (gcc "nnimap+canonical:Sent"))
       (gcc "nnimap+canonical:Sent"))
+     ((header "to" "amin\\.bandali@canonical\\.com")
+      (address "amin.bandali@canonical.com"))
+     ((header "cc" "amin\\.bandali@canonical\\.com")
+      (address "amin.bandali@canonical.com"))
+     ((header "list-id" ".*\\.lists.ubuntu.com")
+      (address "bandali@ubuntu.com")
+      ("X-Message-SMTP-Method" "smtp mail.kelar.org 587"))
      ("nnimap\\+csc:.*"
       (address "bandali@csclub.uwaterloo.ca")
       ("X-Message-SMTP-Method" "smtp mail.csclub.uwaterloo.ca 587")
      ("nnimap\\+csc:.*"
       (address "bandali@csclub.uwaterloo.ca")
       ("X-Message-SMTP-Method" "smtp mail.csclub.uwaterloo.ca 587")
      ,@(if (string= (system-name) "darya")
            '((("canonical" visible nil nil)))
          '((("csc" visible nil nil))
      ,@(if (string= (system-name) "darya")
            '((("canonical" visible nil nil)))
          '((("csc" visible nil nil))
-           (("uwaterloo" visible nil nil))
            (("kelar" visible nil nil))
            (("shemshak" visible nil nil))
            (("gnu" visible nil nil))
            (("kelar" visible nil nil))
            (("shemshak" visible nil nil))
            (("gnu" visible nil nil))
 (with-eval-after-load 'gnus-dired
   (add-hook 'dired-mode-hook 'gnus-dired-mode))
 
 (with-eval-after-load 'gnus-dired
   (add-hook 'dired-mode-hook 'gnus-dired-mode))
 
+(with-eval-after-load 'mm-archive
+  (add-to-list
+   'mm-archive-decoders
+   '("application/gzip" nil "gunzip" "-S" ".zip" "-kd" "%f" "-r")))
+
+(with-eval-after-load 'gnus-start
+  (add-hook 'gnus-after-getting-new-news-hook #'gnus-notifications))
+
 (with-eval-after-load 'mm-decode
   (setq
    ;; mm-attachment-override-types `("text/x-diff" "text/x-patch"
    ;;                                ,@mm-attachment-override-types)
    mm-discouraged-alternatives '("text/html" "text/richtext")
    mm-decrypt-option 'known
 (with-eval-after-load 'mm-decode
   (setq
    ;; mm-attachment-override-types `("text/x-diff" "text/x-patch"
    ;;                                ,@mm-attachment-override-types)
    mm-discouraged-alternatives '("text/html" "text/richtext")
    mm-decrypt-option 'known
-   mm-verify-option 'known))
+   mm-verify-option 'known)
+  (add-to-list
+   'mm-inline-media-tests
+   `("application/gzip" mm-archive-dissect-and-inline identity))
+  (add-to-list 'mm-inlined-types "application/gzip" 'append))
 
 (with-eval-after-load 'mm-uu
   (when (version< "27" emacs-version)
 
 (with-eval-after-load 'mm-uu
   (when (version< "27" emacs-version)