Post by l***@xavier.maillard.imI subscribed to Fastmail service and I'd like to use Gnus to access my
messages. I do not want to start over from scratch (I lost all my .gnus
setup years ago) so I am looking for a ready-to-use-fastmail-setup for
Gnus. Does anybody have this ?
Below is the setup I use for Fastmail. At one point, I think I had trouble using the Fastmail smtp, so that's commented out and this
uses GMail instead. I don't remember the details, but it might be worth getting the Fastmail smtp working again. I left in some
other stuff I had commented out, in case it's useful.
(set-background-color "white")
;; @see http://www.gnu.org/software/emacs/manual/html_node/gnus/Expiring-Mail.html
;; press 'E' to expire email
(setq nnmail-expiry-target "INBOX.Trash")
(setq nnmail-expiry-wait 'immediate)
;; (setq gnus-fetch-old-headers t)
;; (setq gnus-select-method '(nnimap "mail.messagingengine.com" (nnimap-stream ssl) (nnimap-expunge-on-close ask)))
(setq user-mail-address "...")
(setq user-full-name "...")
;; (setq gnus-select-method
;; '(nnimap "gmail"
;; (nnimap-address "imap.gmail.com")
;; (nnimap-server-port 993)
;; (nnimap-stream ssl)))
(setq gnus-select-method
'(nnimap "Fastmail" ; primary email
(nnimap-address "mail.messagingengine.com")
(nnimap-server-port 993)
(nnimap-authenticator login)
(nnimap-expunge-on-close 'never)
(nnimap-stream ssl)
))
;; (setq gnus-select-method
;; '(nnimap "gmail"
;; (nnimap-address "imap.gmail.com")
;; (nnimap-server-port 993)
;; (nnimap-stream ssl)))
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.gmail.com" 587
"..." nil))
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
starttls-use-gnutls t
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
;; (setq send-mail-function 'smtpmail-send-it)
;; (setq message-send-mail-function 'smtpmail-send-it)
;; (setq smtpmail-default-smtp-server "smtps-proxy.messagingengine.com")
;; (setq smtpmail-auth-credentials '(("smtps-proxy.messagingengine.com" "80" "..." "")))
;; (setq smtpmail-starttls-credentials '(("smtps-proxy.messagingengine.com" "80" nil nil)))
(setq gnus-article-browse-delete-temp t)
(setq gnus-fetch-old-headers t)
(setq message-sendmail-envelope-from 'header)
(setq send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "smtps-proxy.messagingengine.com"
smtpmail-smtp-server "smtps-proxy.messagingengine.com"
;; smtpmail-smtp-service 80
;; smtpmail-starttls-credentials '(("smtps-proxy.messagingengine.com" 80 nil nil)))
smtpmail-starttls-credentials '(("smtps-proxy.messagingengine.com" nil nil nil)))
(setq smtpmail-stream-type 'tls)
(setq fill-flowed-display-column nil)
(add-hook 'gnus-article-mode-hook
(lambda ()
(setq
truncate-lines nil
word-wrap t)))
(setq gnus-posting-styles
'((".*"
(name "...")
(address "...")
(BCC "..."))))
(setq gnus-html-frame-width 180)
(defun my-message-mode-setup ()
(setq fill-column 132)
(turn-on-auto-fill))
(add-hook 'message-mode-hook 'my-message-mode-setup)
;;switch to gnus group buffer or start gnus
(defun my-switch-to-gnus-group-buffer ()
"Switch to gnus group buffer if it exists, otherwise start gnus"
(interactive)
(if (or (not (fboundp 'gnus-alive-p))
(not (gnus-alive-p)))
(gnus)
(switch-to-buffer "*Group*")))
(global-set-key (kbd "C-c n") 'my-switch-to-gnus-group-buffer)
;; Set up summary buffer to show tree view, dates
;; (dolist (c '((?\207 . ?q) (?\216 . ?x) (?\212 . ?t) (?\203 . ?m)))
;; (aset standard-display-table (car c)
;; (vector (create-glyph (concat "\e(0" "\e[35m" ; magenta
;; (char-to-string (cdr c))
;; "\e[0m" "\e(B")))))
;; (let ((val 129))
;; (while (< val 160)
;; (aset standard-display-table val (vector (create-glyph val)))
;; (setq val (1+ val))))
;; (setq gnus-summary-line-format "%U%u&thread;%R%d %-5,5L %-20,20n %B%-80,80S\n"
;; gnus-sum-thread-tree-vertical "\216"
;; gnus-sum-thread-tree-root ""
;; gnus-sum-thread-tree-false-root ""
;; gnus-sum-thread-tree-indent " "
;; gnus-sum-thread-tree-single-indent ""
;; gnus-sum-thread-tree-leaf-with-other "\212\207>"
;; gnus-sum-thread-tree-single-leaf "\203\207>")
;; (defun gnus-user-format-function-thread (dummy)
;; (propertize gnus-tmp-thread-tree-header-string 'gnus-face t))
;; (let ((val 129))
;; (while (< val 160)
;; (aset standard-display-table val (vector (create-glyph val)))
;; (setq val (1+ val))))
;; (setq gnus-summary-line-format "%U%R%d %-5,5L %-20,20n %B%-80,80S\n"
;; gnus-sum-thread-tree-vertical "\232"
;; gnus-sum-thread-tree-root ""
;; gnus-sum-thread-tree-false-root ""
;; gnus-sum-thread-tree-indent " "
;; gnus-sum-thread-tree-single-indent ""
;; gnus-sum-thread-tree-leaf-with-other "\226\223>"
;; gnus-sum-thread-tree-single-leaf "\217\223>")
(setq-default
gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n"
gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
gnus-thread-sort-functions '(gnus-thread-sort-by-date)
gnus-sum-thread-tree-false-root ""
gnus-sum-thread-tree-indent " "
gnus-sum-thread-tree-leaf-with-other "├► "
gnus-sum-thread-tree-root ""
gnus-sum-thread-tree-single-leaf "└► "
gnus-sum-thread-tree-vertical "│")
;;;
;; Scrolling like mutt for group, summary, and article buffers.
;;
;; Being able to scroll the current buffer view by one line with a
;; single key, rather than having to guess a random number and recenter
;; with `C-u NUM C-l' is _very_ convenient. Mutt binds scrolling by one
;; line to '<' and '>', and it's something I often miss when working
;; with Gnus buffers. Thanks to the practically infinite customizability
;; of Gnus, this doesn't have to be an annoyance anymore.
;; (defun keramida-mutt-like-scrolling ()
;; "Set up '<' and '>' keys to scroll down/up one line, like mutt."
;; ;; mutt-like scrolling of summary buffers with '<' and '>' keys.
;; (local-set-key (kbd ">") 'scroll-up-line)
;; (local-set-key (kbd "<") 'scroll-down-line))
;; (add-hook 'gnus-group-mode-hook 'keramida-mutt-like-scrolling)
;; (add-hook 'gnus-summary-mode-hook 'keramida-mutt-like-scrolling)
;; (add-hook 'gnus-article-prepare-hook 'keramida-mutt-like-scrolling)
;; BBDB
;; (require 'bbdb)
;; (bbdb-initialize 'gnus 'message)
;; (require 'gnus-registry)
;; (gnus-registry-initialize)
(defun pd/alter-group-map ()
(local-set-key "h" "jINBOX"))
;; From Peter Münster <***@free.fr>
(defun pm/alter-summary-map ()
(local-set-key "d" [?M ?M ?e ?e down ?g])
(local-set-key "vj" "BmINBOX.Junk Mail"))
(defun pm/alter-article-map ()
(local-set-key "d" "MMeen"))
(add-hook 'gnus-group-mode-hook 'pd/alter-group-map)
(add-hook 'gnus-summary-mode-hook 'pm/alter-summary-map)
(add-hook 'gnus-article-mode-hook 'pm/alter-article-map)
;; insert x-face
(defun mail-insert-x-face ()
(save-excursion
(goto-char (point-min))
(search-forward mail-header-separator)
(beginning-of-line nil)
(insert "X-Face: ")
(insert-file "~/xface.dat")))
(add-hook 'message-send-hook 'mail-insert-x-face)
(setq message-required-headers ())
(setq message-required-mail-headers
(nconc message-required-headers
(list '(Face . (lambda ()
(gnus-face-from-file "~/Dropbox/pd-logo-face.png"))))))