gnus.el 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. ;; ID stuff
  2. (setq user-mail-address "emilia.blasten@iki.fi"
  3. mail-host-address "iki.fi"
  4. user-full-name "Emilia Blåsten"
  5. message-dont-reply-to-names '("emilia.blasten@iki.fi"
  6. "emilia.blasten@lut.fi"
  7. "emilia@tranfem.fi"
  8. "emilia@transfeminiinit.fi"))
  9. ;; Password xoauth2 stuff
  10. (require 'auth-source-xoauth2)
  11. (require 'gnus-secrets "~/.gnus-secrets.el.gpg")
  12. (setq auth-source-xoauth2-creds 'my-xoauth2-get-secrets)
  13. (add-to-list 'smtpmail-auth-supported 'xoauth2)
  14. (auth-source-xoauth2-enable)
  15. ;; IMAP stuff
  16. (setq gnus-select-method '(nnnil nil))
  17. (setq gnus-secondary-select-methods '((nnimap "cmail"
  18. (nnimap-address "imap1.countermail.com")
  19. (nnimap-server-port 993)
  20. (nnimap-stream tls))
  21. (nnimap "transfem"
  22. (nnimap-address "imap.gmail.com")
  23. (nnimap-server-port 993)
  24. (nnimap-stream tls))
  25. (nnimap "LUT"
  26. (nnimap-address "outlook.office365.com")
  27. (nnimap-user "emilia.blasten@lut.fi")
  28. (nnimap-authenticator xoauth2)
  29. (nnimap-server-port 993)
  30. (nnimap-stream tls))
  31. (nnimap "mailbox.org"
  32. (nnimap-address "imap.mailbox.org")
  33. (nnimap-server-port 993)
  34. (nnimap-stream tls))
  35. (nnimap "youtuber"
  36. (nnimap-address "imap.gmail.com")
  37. (nnimap-user "cursed.emilia@gmail.com")
  38. (nnimap-authenticator xoauth2)
  39. (nnimap-server-port 993)
  40. (nnimap-stream tls))))
  41. ;; Level stuff (for speed etc.)
  42. ; Read
  43. ; https://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Levels.html
  44. ; and
  45. ; https://emacs.stackexchange.com/questions/34537/how-to-prevent-gnus-from-querying-the-server-during-startup
  46. (setq gnus-activate-level 5) ; Default 6, groups with level above this
  47. ; won't be activated. Use 'S l' on a
  48. ; group to give it a new level (if you
  49. ; want to make it activated or not). Use
  50. ; e.g. '6 g' to refresh all groups level
  51. ; 6 or below.
  52. (setq gnus-check-new-newsgroups nil) ; don't check server for new
  53. ; stuff. Use 'U' in group buffer
  54. ; to addd new groups.
  55. ;; smallest set of conditions first
  56. (with-eval-after-load 'gnus-group
  57. (add-to-list 'gnus-group-highlight
  58. '((and mailp (>= level 4) (<= level 6))
  59. . gnus-group-mail-3))
  60. (add-to-list 'gnus-group-highlight
  61. '((and mailp (= unread 0) (>= level 4) (<= level 6))
  62. . gnus-group-mail-3-empty)))
  63. ;; SMTP stuff & sending related stuff
  64. (setq smtpmail-smtp-server "smtp.iki.fi"
  65. smtpmail-stream-type 'starttls
  66. smtpmail-smtp-service 587
  67. gnus-gcc-mark-as-read t)
  68. (with-eval-after-load 'smtpmail
  69. (add-to-list 'smtpmail-auth-supported 'xoauth2)) ; add "smtp-auth XXX" to .authinfo.gpg to select xoauth2/cram-md5/login/plain as an authentication type if the default fails.
  70. (setq gnus-message-archive-group
  71. '(("LUT" "nnimap+LUT:INBOX") ; Items seem to go "nnimap+LUT:Sent Items" automatically. The server does that. Just clear that group every now and then...
  72. ("transfem" "nnimap+transfem:INBOX")
  73. ("cmail" "nnimap+cmail:INBOX")
  74. ("youtuber" "nnimap+youtuber:INBOX")))
  75. (setq gnus-posting-styles
  76. '((".*" ; Matches all groups of messages
  77. (address "Emilia Blåsten <emilia.blasten@iki.fi>")
  78. ("X-Message-SMTP-Method" "smtp smtp.iki.fi 587 emilia.blasten@iki.fi"))
  79. ;; ("mailbox.org" ; Matches Gnus group called "mailbox.org"
  80. ;; (address "Emilia Blåsten <drblasten@mailbox.org>")
  81. ;; ("X-Message-SMTP-Method" "smtp smtp.mailbox.org 587 drblasten@mailbox.org"))
  82. ("transfem" ; Matches Gnus group called "transfem"
  83. (address "Emilia Blåsten <emilia@transfeminiinit.fi>")
  84. (organization "Transfeminiinit ry")
  85. ("X-Message-SMTP-Method" "smtp smtp.gmail.com 587 emilia@transfeminiinit.fi"))
  86. ("LUT" ; Matches Gnus group called "LUT"
  87. (address "Emilia L.K. Blåsten <emilia.blasten@lut.fi>")
  88. (organization "LUT University")
  89. ("X-Message-SMTP-Method" "smtp smtp-mail.outlook.com 587 emilia.blasten@lut.fi"))
  90. ("youtuber" ; Matches Gnus group called "youtuber"
  91. (address "Cursed Emilia <cursed.emilia@gmail.com>")
  92. ("X-Message-SMTP-Method" "smtp smtp.gmail.com 587 cursed.emilia@gmail.com"))))
  93. ;; Interface stuff
  94. (setq gnus-summary-line-format "%U%R %&user-date; %B%-31,31s %4k %uB\n"
  95. ;; Default with %f ('Name, To header or Newsgroups header')
  96. ;; replaced by %uB (BBDB Name + Known poster indicator '+')
  97. gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
  98. gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
  99. gnus-summary-gather-subject-limit 'fuzzy
  100. gnus-fetch-old-headers t
  101. gnus-article-sort-functions '(gnus-article-sort-by-date)
  102. gnus-thread-sort-functions '((not gnus-thread-sort-by-most-recent-date))
  103. gnus-subthread-sort-functions '(gnus-thread-sort-by-date)
  104. gnus-sum-thread-tree-false-root ""
  105. gnus-sum-thread-tree-indent " "
  106. gnus-sum-thread-tree-leaf-with-other "├► "
  107. gnus-sum-thread-tree-root ""
  108. gnus-sum-thread-tree-single-leaf "╰► "
  109. gnus-sum-thread-tree-vertical "│")
  110. ;; Set group parameters. Press "G c" on a group name and -more- to find more info.
  111. (setq gnus-parameters
  112. '(("cmail:INBOX" ; Emilia Countermail
  113. (auto-expire . nil)
  114. (expiry-wait . 7)
  115. (expiry-target . "nnimap+cmail:Trash"))
  116. ("cmail:Spam"
  117. (total-expire . t)
  118. (expiry-wait . 7)
  119. (expiry-target . "nnimap+cmail:Trash"))
  120. ("cmail:Trash"
  121. (auto-expire . t)
  122. (expiry-wait . 31)
  123. (expiry-target . delete))
  124. ("transfem:INBOX" ; Emilia Transfeminiinit hallitus
  125. (auto-expire . nil)
  126. (expiry-wait . 7)
  127. (expiry-target . "nnimap+transfem:[Gmail]/Bin"))
  128. ("transfem:[Gmail]/Spam"
  129. (total-expire . t)
  130. (expiry-wait . 7)
  131. (expiry-target . "nnimap+tranfem:[Gmail]/Bin"))
  132. ("transfem:[Gmail]/Bin"
  133. (auto-expire . t)
  134. (expiry-wait . 31)
  135. (expiry-target . delete))
  136. ("LUT:INBOX" ; LUT University
  137. (auto-expire . nil)
  138. (expiry-wait . 7)
  139. (expiry-target . "nnimap+LUT:Deleted Items"))
  140. ("LUT:Junk Email"
  141. (total-expire . t)
  142. (expiry-wait . 7)
  143. (expiry-target . "nnimap+LUT:Deleted Items"))
  144. ("LUT:Deleted Items"
  145. (auto-expire . t)
  146. (expiry-wait . 31)
  147. (expiry-target . delete))
  148. ("LUT:Trash"
  149. (auto-expire . t)
  150. (expiry-wait . 31)
  151. (expiry-target . delete))
  152. ("mailbox.org:INBOX" ; Emilia mailbox.org
  153. (total-expire . t) ;see below suppress duplicates
  154. (expiry-wait . 7)
  155. (expiry-target . "nnimap+mailbox.org:Trash"))
  156. ("mailbox.org:Junk"
  157. (total-expire . t)
  158. (expiry-wait . 7)
  159. (expiry-target . "nnimap+mailbox.org:Trash"))
  160. ("mailbox.org:Trash"
  161. (total-expire . t) ; Because duplicate suppression doesn't put the E symbol on them. Marks them read though.
  162. (expiry-wait . 31)
  163. (expiry-target . delete))
  164. ("youtuber:INBOX" ; Cursed Emilia gmail
  165. (auto-expire . nil)
  166. (expiry-wait . 7)
  167. (expiry-target . "nnimap+youtuber:[Gmail]/Bin"))
  168. ("youtuber:[Gmail]/Spam"
  169. (total-expire . t)
  170. (expiry-wait . 7)
  171. (expiry-target . "nnimap+youtuber:[Gmail]/Bin"))
  172. ("youtuber:[Gmail]/Bin"
  173. (auto-expire . t)
  174. (expiry-wait . 31)
  175. (expiry-target . delete))))
  176. (setq gnus-suppress-duplicates t) ;make it so a read article marks duplicated read when seen them. So mailbox.org articles are marked as read (and total-expire moves them to Trash) when reading them elsewhere. WARNING: reading in mailbox.org marks them read elsewhere too.
  177. ;; Security stuff
  178. (setq mm-verify-option "always"
  179. gnus-buttonized-mime-types '("multipart/signed") ; show verified key etc
  180. ; mm-sign-option 'guided ; for always selecting signing key from a menu
  181. mml-secure-openpgp-encrypt-to-self t
  182. mml-secure-smime-encrypt-to-self t
  183. mml-secure-openpgp-sign-with-sender t
  184. mml-secure-smime-sign-with-sender t
  185. gnus-message-replysignencrypted t)
  186. (add-hook 'gnus-message-setup-hook 'mml-secure-message-sign-pgpmime) ; Always sign