gnus.el 8.3 KB

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