The configuration of Collin Doering
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
4.5KB

  1. ;; File: .gnus
  2. ;; Author: Collin J. Doering <rekahsoft@gmail.com>
  3. ;; Date: Jan 20, 2011
  4. ;; Description: Configuration file for gnus mail reader (in emacs-lisp)
  5. (require 'cl)
  6. (require 'smtpmail)
  7. (setq user-mail-address "collin.doering@gmail.com"
  8. user-full-name "Collin J. Doering"
  9. smtpmail-smtp-server "smtp.gmail.com"
  10. smtpmail-smtp-service 587
  11. smtpmail-auth-credentials "~/.authinfo.gpg"
  12. message-send-mail-function 'smtpmail-send-it)
  13. (setq nnmail-expiry-wait 2
  14. nnmail-resplit-incoming t)
  15. (setq smtpmail-debug-info t)
  16. (setq smtpmail-stream-type 'starttls) ;; If using TLS/SSL. Use C-h v smtpmail-stream-type RET to see possible values
  17. (setq smtp-accounts
  18. '(("collin.doering@gmail.com" "Collin J. Doering" "smtp.gmail.com")
  19. ("rekahsoft@gmail.com" "rekahsoft" "smtp.gmail.com")))
  20. (defun my-change-smtp ()
  21. (save-excursion
  22. (loop with from = (save-restriction
  23. (message-narrow-to-headers)
  24. (message-fetch-field "from"))
  25. for (addr fname server) in smtp-accounts
  26. when (string-match addr from)
  27. do (setq user-mail-address addr
  28. user-full-name fname
  29. smtpmail-smtp-server server
  30. smtpmail-smtp-user addr))))
  31. (defadvice smtpmail-via-smtp
  32. (before change-smtp-by-message-from-field (recipient buffer &optional ask) activate)
  33. (with-current-buffer buffer (my-change-smtp)))
  34. (ad-activate 'smtpmail-via-smtp)
  35. ;; setting up posting styles
  36. (setq gnus-posting-styles
  37. '((".*"
  38. (address "rekahsoft@gmail.com")
  39. (name "Collin J. Doering (RekahSoft)"))
  40. ("collin.doering@gmail.com"
  41. (address "collin.doering@gmail.com")
  42. (name "Collin J. Doering"))
  43. ("rekahsoft.mail@gmail.com"
  44. (address "rekahsoft.mail@gmail.com")
  45. (name "RekahSoft"))
  46. ("collin.doering@rekahsoft.ca"
  47. (address "collin.doering@rekahsoft.ca")
  48. (name "Collin J. Doering"))
  49. ("support@rekahsoft.ca"
  50. (address "support@rekahsoft.ca")
  51. (name "Rekahsoft Support"))
  52. ("info@rekahsoft.ca"
  53. (address "info@rekahsoft.ca")
  54. (name "RekahSoft Info"))
  55. ))
  56. ;; set primary select method..
  57. (setq gnus-select-method '(nnimap "collin.doering"
  58. (remove-prefix "INBOX.")
  59. (nnimap-address "imap.gmail.com")
  60. (nnimap-server-port 993)
  61. (nnimap-stream ssl)
  62. (nnimap-authinfo-file "~/.authinfo.gpg")))
  63. ;; set secondary select methods
  64. (setq gnus-secondary-select-methods
  65. '((nnimap "rekahsoft"
  66. (remove-prefix "INBOX.")
  67. (nnimap-address "imap.gmail.com")
  68. (nnimap-server-port 993)
  69. (nnimap-stream ssl)
  70. (nnimap-authinfo-file "~/.authinfo.gpg"))
  71. (nnimap "collin.doering"
  72. (nnimap-address "hp131.hostpapa.com")
  73. (nnimap-server-port 993)
  74. (nnimap-stream ssl)
  75. (nnimap-authinfo-file "~/.authinfo.gpg"))
  76. (nnimap "info"
  77. (nnimap-address "hp131.hostpapa.com")
  78. (nnimap-server-port 993)
  79. (nnimap-stream ssl)
  80. (nnimap-authinfo-file "~/.authinfo.gpg"))
  81. (nnimap "support"
  82. (nnimap-address "hp131.hostpapa.com")
  83. (nnimap-server-port 993)
  84. (nnimap-stream ssl)
  85. (nnimap-authinfo-file "~/.authinfo.gpg"))))
  86. ;; (nnimap "rekahsoft.mail"
  87. ;; (remove-prefix "INBOX.")
  88. ;; (nnimap-address "imap.gmail.com")
  89. ;; (nnimap-server-port 993)
  90. ;; (nnimap-stream ssl)
  91. ;; (nnimap-authinfo-file "~/.rkm-authinfo.gpg"))))
  92. (remove-hook 'gnus-mark-article-hook
  93. 'gnus-summary-mark-read-and-unread-as-read)
  94. (add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
  95. ;;gnus-group-line-format's default value was
  96. ;;"%M%S%p%P%5y:%B%(%g%)%l %O\n"
  97. ;;(setq gnus-group-line-format "%M%S%5y/%-5t: %uG %D\n")
  98. (setq gnus-group-line-format "%M%S%p%P%5y:%B%(%uG%)%l %O\n")
  99. (defun gnus-user-format-function-G (arg)
  100. (concat (car (cdr gnus-tmp-method)) ":"
  101. (or (gnus-group-find-parameter gnus-tmp-group 'display-name)
  102. (let ((prefix (assq 'remove-prefix (cddr gnus-tmp-method))))
  103. (if (and prefix
  104. (string-match (concat "^\\("
  105. (regexp-quote (cadr prefix))
  106. "\\)")
  107. gnus-tmp-qualified-group))
  108. (substring gnus-tmp-qualified-group (match-end 1))
  109. gnus-tmp-qualified-group)))))
  110. (setq gnus-thread-hide-subtree t)
  111. (setq gnus-summary-same-subject "")
  112. (setq gnus-sum-thread-tree-root "")
  113. (setq gnus-sum-thread-tree-single-indent "")
  114. (setq gnus-sum-thread-tree-leaf-with-other "+-> ")
  115. (setq gnus-sum-thread-tree-vertical "|")
  116. (setq gnus-sum-thread-tree-single-leaf "`-> ")
  117. ;; (require 'gnus-demon)
  118. ;; (setq gnus-use-demon t)
  119. ;; (gnus-demon-add-handler 'gnus-group-get-new-news 10 2)
  120. ;; (gnus-demon-init)