5 ms·
I've extracted the relevant bits below, the rest is the usual SMTP setup everybody uses. I didn't just copy and paste because it's intertwined with the rest of
by gkya 9y ago
I've extracted the relevant bits below, the rest is the usual SMTP setup everybody uses. I didn't just copy and paste because it's intertwined with the rest of my config that I'd have to publish all of it [1]and also I removed some private stuff. I suggest you pick what you like but reading the documentation carefully. With Gmane, when you first run Gnus you should pick the newsgroups you want to follow, hit ^ on Group buffer to get the server buffer and subscribe with `u' to any group you like on the server.
[1] I'd have to kill the mercurial repo and start brand new if I wanted to publish my emacs.d, thus I don't publish it. Maybe one day I'll get around to figure out if I ever had any really confidential stuff in there and publish it if not.
(require 'rx)
(require 'mail-source)
(require 'spam)
(require 'gnus)
(require 'message)
(setf
;; Gmail does not like parens.
message-from-style 'angles)
;;; Mail sources:
(setf
mail-sources
`((pop :server "some server" :user "user name" :port 995)
,(let ((f (expand-file-name (user-login-name) "/var/mail"))) ;system mailbox
(list 'file :path f))))
;;; Spam:
(spam-initialize)
(setf
spam-use-BBDB t ; whitelist from BBDB contacts
spam-use-spamassassin t
spam-assassin-program (gk-executable-ensure "spamc")
gnus-spam-newsgroup-contents '(("spam" gnus-group-spam-classification-spam))
;;; Splitting mail:
nnmail-split-methods 'nnmail-split-fancy
nnmail-split-fancy-match-partial-words t
nnmail-split-fancy
`(| (: spam-split)
;; Github:
("List-Id" "cadadr/" "inbox") ; Github issues on my github repos.
("From" "notifications@github.com" "github") ; other
;; News:
(| ("From" "newsletter@newspaper.com" "news"))
;; Announcements:
(| ("To" "info-gnu@gnu.org" "announcements"))
;; Links:
("Subject" "_link_" "link")
;; Files:
("Subject" "_file_" "file")
;; Self mail:
("From" ,(macroexpand `(rx ,user-mail-address)) "self")
("From" ,(rx "my other email address") "self")
("From" ,(rx "another address of mine") "self")
;; Rest goes to the inbox:
"inbox"))
;;; Gnus:
(setf
;;;; Mail sources:
gnus-select-method '(nnml "") ;uses mail-sources
gnus-secondary-select-methods
'((nntp "gmane"
(nntp-address "news.gmane.org")))
;;;; Mime:
gnus-buttonized-mime-types
'("multipart/signed" "multipart/alternative" "text/html" "text/x-diff"
"text/x-patch" "text/vcard" "text/x-org"))
;;;; Keys:
;; Render article in browser.
(define-key gnus-article-mode-map "\C-cw" 'gnus-article-browse-html-article)
;;;; Gnus ui:
(require 'gnus-sum)
(setf
;; U: read status
;; R: A if replied to,‘ ’ if not
;; z: zscore (char)
;; B: trn-style indentation based on thread level
;; f: contents of the from or to headers.
;; s: subject or empty str if not thread root
gnus-summary-line-format "%U%R%z %B%(%-23,23f%) %s \n")
;; Switch topics on and collapse all threads. Collapsed threads
;; expand automatically when you hit RET on them, and there's a
;; threads menu for the summary buffer where many commands are listed.
;; I suggest you keep menu-bar-mode on for at least Gnus as it is very
;; helpful when discovering new commands.
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(add-hook 'gnus-summary-prepared-hook 'gnus-summary-hide-all-threads)
- nextos 9y agoThanks! Do you know nnir has a notmuch backend now? So one can avoid running Dovecot locally and still have great search capabilities with a mbsync+notmuch setup.
- gkya 9y agoYou're welcome, and yes, I recall having read that somewhere, and I've used notmuch (and mairix) with emacs in the past, but I've found out that searching subject lines in the summary buffer is sufficient %90-95 of the time, so I did not set Gnus up with a search helper to avoid complexity (YMMV). I just pop all my mail and store it locally anyways (except NNTP which I don't copy locally) so it's fast to make Gnus show thousands of messages and isearch through them (not accumulating all messages in a single group and aggressive spam checks help).