2016-10-19 21:04:23 +02:00
|
|
|
Gnus is one of the most extensible Email programs on the
|
|
|
|
planet. And it's not even made for email but NNTP.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(require 'gnus)
|
|
|
|
(require 'gnus-msg)
|
|
|
|
(require 'mail-source)
|
|
|
|
(require 'message)
|
|
|
|
(require 'nnfolder)
|
|
|
|
(require 'sendmail)
|
|
|
|
|
|
|
|
(require 'oni-helpers)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Store all Gnus-related data in my data directory.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq gnus-directory (oni:data-location "News")
|
|
|
|
gnus-article-save-directory gnus-directory
|
|
|
|
gnus-cache-directory gnus-directory
|
|
|
|
gnus-kill-files-directory gnus-directory)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Store all Mail source-related data in my data directory.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq mail-source-directory (oni:data-location "Mail"))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Store all message-related data in the same place as the Mail source
|
|
|
|
data.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq message-directory (oni:data-location "Mail"))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Store all nnfolder-related data in the same place as the Mail
|
|
|
|
source data.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq nnfolder-directory (oni:data-location "Mail"))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Use msmtp to send mail.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq send-mail-function 'sendmail-send-it)
|
|
|
|
(setq sendmail-program "/usr/bin/msmtp")
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Tell Gnus I'm not a novice anymore. One of the features of Gnus I
|
|
|
|
use a lot is deleting messages and as long as Gnus thinks I'm a
|
|
|
|
novice it will ask me if I'm sure every single time.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq gnus-novice-user nil)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Add a keybinding to the Gnus summary mode to easily delete
|
|
|
|
messages.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(define-key gnus-summary-mode-map (kbd "M-d") 'oni-gnus-delete-forward)
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-10-19 22:52:51 +02:00
|
|
|
Change the Gnus group buffer line format.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq gnus-group-line-format "%P%(%20G%): %-10s %S%p%B %5y %5T\n")
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-10-19 21:04:23 +02:00
|
|
|
* ryuslash.org
|
|
|
|
|
|
|
|
Set my main email address as the primary select method for Gnus.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq gnus-select-method
|
|
|
|
'(nnmaildir "ryuslash" (directory "~/documents/mail/ryuslash/")))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
When sending mail from the ryuslash inbox, use the ryuslash msmtp
|
|
|
|
account.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(add-to-list 'gnus-posting-styles
|
|
|
|
'(".*"
|
|
|
|
(address "tom@ryuslash.org")
|
|
|
|
(eval (setq message-sendmail-extra-arguments
|
|
|
|
'("-a" "ryuslash")))))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* gmail
|
|
|
|
|
|
|
|
Add my other personal email as a secondary select method.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(add-to-list 'gnus-secondary-select-methods
|
|
|
|
'(nnmaildir "gmail"
|
|
|
|
(directory "~/documents/mail/gmail/")))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
When sending mail from the gmail account, use the gmail msmtp
|
|
|
|
accound and set the proper email address.
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(add-to-list 'gnus-posting-styles
|
|
|
|
'("gmail:"
|
|
|
|
(name "Tom Willemse")
|
|
|
|
(address "ryuslash@gmail.com")
|
|
|
|
(eval (setq message-sendmail-extra-arguments
|
|
|
|
'("-a" "gmail")))))
|
|
|
|
#+END_SRC
|