gnus.el 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ;; Password xoauth2 stuff
  2. (use-package auth-source-xoauth2 :ensure t)
  3. (require 'gnus-secrets "~/.gnus-secrets.el.gpg")
  4. (setq auth-source-xoauth2-creds 'my-xoauth2-get-secrets)
  5. (add-to-list 'smtpmail-auth-supported 'xoauth2)
  6. (auth-source-xoauth2-enable)
  7. ;;; Sending related stuff
  8. ;; Save sent file to same group where located (using GCC-field)
  9. (setq gnus-message-archive-method '(nnimap ""))
  10. (setq gnus-message-archive-group
  11. '((lambda (group)
  12. (cond
  13. ;; Store personal mail messages in the same group I started out in
  14. ((string-match "nnimap.*" group) group)
  15. ;; Store everything else in misc until I can sort it out
  16. (t "mail.misc")))))
  17. ;;; Level stuff (for speed etc.)
  18. ;; Read
  19. ;; https://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Levels.html
  20. ;; and
  21. ;; https://emacs.stackexchange.com/questions/34537/how-to-prevent-gnus-from-querying-the-server-during-startup
  22. (setq gnus-activate-level 5) ; Default 6, groups with level above this
  23. ; won't be activated. Use 'S l' on a
  24. ; group to give it a new level (if you
  25. ; want to make it activated or not). Use
  26. ; e.g. '6 g' to refresh all groups level
  27. ; 6 or below.
  28. (setq gnus-check-new-newsgroups nil) ; don't check server for new
  29. ; stuff. Use 'U' in group buffer
  30. ; to add new groups.
  31. ;;; Highlighting: smallest set of conditions first
  32. (with-eval-after-load 'gnus-group
  33. (add-to-list 'gnus-group-highlight
  34. '((and mailp (>= level 4) (<= level 6))
  35. . gnus-group-mail-3))
  36. (add-to-list 'gnus-group-highlight
  37. '((and mailp (= unread 0) (>= level 4) (<= level 6))
  38. . gnus-group-mail-3-empty)))
  39. ;;; Interface stuff
  40. (setq gnus-summary-line-format "%U%R %&user-date; %B%-31,31s %4k %uB\n"
  41. ;; Default with %f ('Name, To header or Newsgroups header')
  42. ;; replaced by %uB (BBDB Name + Known poster indicator '+')
  43. gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
  44. gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
  45. gnus-summary-gather-subject-limit 'fuzzy
  46. gnus-fetch-old-headers t
  47. gnus-article-sort-functions '(gnus-article-sort-by-date)
  48. gnus-thread-sort-functions '((not gnus-thread-sort-by-most-recent-date))
  49. gnus-subthread-sort-functions '((not gnus-thread-sort-by-date))
  50. gnus-sum-thread-tree-false-root ""
  51. gnus-sum-thread-tree-indent " "
  52. gnus-sum-thread-tree-leaf-with-other "├► "
  53. gnus-sum-thread-tree-root ""
  54. gnus-sum-thread-tree-single-leaf "╰► "
  55. gnus-sum-thread-tree-vertical "│")
  56. ;; Make it so a read article marks duplicated read when seen them. So
  57. ;; articles in the backup server are marked as read (and total-expire
  58. ;; moves them to Trash) when reading them elsewhere. WARNING: reading
  59. ;; in the duplicate server marks them read elsewhere too.
  60. (setq gnus-suppress-duplicates t)
  61. ;; Also make it so that when on auto-expiry, only unread messages that
  62. ;; are read will be automatically marked as expired. I.e. something
  63. ;; explicitly marked as read 'd' will not be marked as expired under
  64. ;; auto-expire.
  65. (remove-hook 'gnus-mark-article-hook
  66. 'gnus-summary-mark-read-and-unread-as-read)
  67. ;; (add-hook 'gnus-mark-article-hook
  68. ;; 'gnus-summary-mark-unread-as-read)
  69. (add-hook 'gnus-summary-mode-hook 'my-alter-summary-map)
  70. (defun my-alter-summary-map ()
  71. (keymap-local-set "E" 'gnus-summary-put-mark-as-expirable)
  72. (keymap-local-set "?" 'gnus-summary-put-mark-as-dormant)
  73. (keymap-local-set "!" 'gnus-summary-put-mark-as-ticked)
  74. (keymap-local-set "M-u" 'gnus-summary-put-mark-as-unread)
  75. (keymap-local-set "d" 'gnus-summary-put-mark-as-read))
  76. ;;; Security stuff
  77. (setq mm-verify-option "always"
  78. gnus-buttonized-mime-types '("multipart/signed") ; show verified key etc
  79. ;; mm-sign-option 'guided ; for always selecting signing key from a menu
  80. mml-secure-openpgp-encrypt-to-self t
  81. mml-secure-smime-encrypt-to-self t
  82. mml-secure-openpgp-sign-with-sender t
  83. mml-secure-smime-sign-with-sender t
  84. gnus-message-replysignencrypted t)
  85. (add-hook 'gnus-message-setup-hook 'mml-secure-message-sign-pgpmime) ; Always sign