;; File: .gnus
;; Author: Collin J. Doering <rekahsoft@gmail.com>
;; Date: Jan 20, 2011
;; Description: Configuration file for gnus mail reader (in emacs-lisp)
(require 'cl)
(require 'smtpmail)
(setq user-mail-address "collin.doering@gmail.com"
user-full-name "Collin J. Doering"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
smtpmail-auth-credentials "~/.authinfo.gpg"
message-send-mail-function 'smtpmail-send-it)
(setq nnmail-expiry-wait 2
nnmail-resplit-incoming t)
(setq smtpmail-debug-info t)
(setq smtpmail-stream-type 'starttls) ;; If using TLS/SSL. Use C-h v smtpmail-stream-type RET to see possible values
(setq smtp-accounts
'(("collin.doering@gmail.com" "Collin J. Doering" "smtp.gmail.com")
("rekahsoft@gmail.com" "rekahsoft" "smtp.gmail.com")))
(defun my-change-smtp ()
(save-excursion
(loop with from = (save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))
for (addr fname server) in smtp-accounts
when (string-match addr from)
do (setq user-mail-address addr
user-full-name fname
smtpmail-smtp-server server
smtpmail-smtp-user addr))))
(defadvice smtpmail-via-smtp
(before change-smtp-by-message-from-field (recipient buffer &optional ask) activate)
(with-current-buffer buffer (my-change-smtp)))
(ad-activate 'smtpmail-via-smtp)
;; setting up posting styles
(setq gnus-posting-styles
'((".*"
(address "rekahsoft@gmail.com")
(name "Collin J. Doering (RekahSoft)"))
("collin.doering@gmail.com"
(address "collin.doering@gmail.com")
(name "Collin J. Doering"))
("rekahsoft.mail@gmail.com"
(address "rekahsoft.mail@gmail.com")
(name "RekahSoft"))
("collin.doering@rekahsoft.ca"
(address "collin.doering@rekahsoft.ca")
("support@rekahsoft.ca"
(address "support@rekahsoft.ca")
(name "Rekahsoft Support"))
("info@rekahsoft.ca"
(address "info@rekahsoft.ca")
(name "RekahSoft Info"))
))
;; set primary select method..
(setq gnus-select-method '(nnimap "collin.doering"
(remove-prefix "INBOX.")
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)
(nnimap-authinfo-file "~/.authinfo.gpg")))
;; set secondary select methods
(setq gnus-secondary-select-methods
'((nnimap "rekahsoft"
(nnimap-authinfo-file "~/.authinfo.gpg"))
(nnimap "collin.doering"
(nnimap-address "hp131.hostpapa.com")
(nnimap "info"
(nnimap "support"
(nnimap-authinfo-file "~/.authinfo.gpg"))))
;; (nnimap "rekahsoft.mail"
;; (remove-prefix "INBOX.")
;; (nnimap-address "imap.gmail.com")
;; (nnimap-server-port 993)
;; (nnimap-stream ssl)
;; (nnimap-authinfo-file "~/.rkm-authinfo.gpg"))))
(remove-hook 'gnus-mark-article-hook
'gnus-summary-mark-read-and-unread-as-read)
(add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
;;gnus-group-line-format's default value was
;;"%M%S%p%P%5y:%B%(%g%)%l %O\n"
;;(setq gnus-group-line-format "%M%S%5y/%-5t: %uG %D\n")
(setq gnus-group-line-format "%M%S%p%P%5y:%B%(%uG%)%l %O\n")
(defun gnus-user-format-function-G (arg)
(concat (car (cdr gnus-tmp-method)) ":"
(or (gnus-group-find-parameter gnus-tmp-group 'display-name)
(let ((prefix (assq 'remove-prefix (cddr gnus-tmp-method))))
(if (and prefix
(string-match (concat "^\\("
(regexp-quote (cadr prefix))
"\\)")
gnus-tmp-qualified-group))
(substring gnus-tmp-qualified-group (match-end 1))
gnus-tmp-qualified-group)))))
(setq gnus-thread-hide-subtree t)
(setq gnus-summary-same-subject "")
(setq gnus-sum-thread-tree-root "")
(setq gnus-sum-thread-tree-single-indent "")
(setq gnus-sum-thread-tree-leaf-with-other "+-> ")
(setq gnus-sum-thread-tree-vertical "|")
(setq gnus-sum-thread-tree-single-leaf "`-> ")
;; (require 'gnus-demon)
;; (setq gnus-use-demon t)
;; (gnus-demon-add-handler 'gnus-group-get-new-news 10 2)
;; (gnus-demon-init)