gnus.el 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 '((not gnus-article-sort-by-date))
  48. gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date)
  49. gnus-subthread-sort-functions '(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. ;;; Security stuff
  70. (setq mm-verify-option "always"
  71. gnus-buttonized-mime-types '("multipart/signed") ; show verified key etc
  72. ;; mm-sign-option 'guided ; for always selecting signing key from a menu
  73. mml-secure-openpgp-encrypt-to-self t
  74. mml-secure-smime-encrypt-to-self t
  75. mml-secure-openpgp-sign-with-sender t
  76. mml-secure-smime-sign-with-sender t
  77. gnus-message-replysignencrypted t)
  78. (add-hook 'gnus-message-setup-hook 'mml-secure-message-sign-pgpmime) ; Always sign