-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gnus
138 lines (122 loc) · 4.46 KB
/
.gnus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
;;; .gnus --- GNUS Settings
;;; Commentary:
;; autoload by gnus
;;; Code:
;; (STATELESS BEGIN)
(use-package smtpmail-multi
:ensure t
:config
(setq send-mail-function (quote smtpmail-multi-send-it))
(setq message-send-mail-function (quote smtpmail-multi-send-it)))
(use-package ebdb
:ensure t
:config
(setq ebdb-mua-pop-up nil)
(require 'ebdb-gnus))
(use-package company-ebdb
:ensure t
:config (add-to-list 'company-backends 'company-ebdb))
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq gnus-large-newsgroup 50)
(setq gnus-select-method '(nnml ""))
(setq gnus-gcc-mark-as-read t)
(setq mm-discouraged-alternatives '("text/html"))
(defvar topic-topology nil)
(defvar topic-alist nil)
(defvar email-addresses nil)
;; https://www.emacswiki.org/emacs/GnusDemon
(gnus-demon-add-handler 'gnus-demon-scan-news 5 t)
(add-hook 'gnus-after-getting-new-news-hook 'gnus-notifications)
(setq gnus-notifications-minimum-level 3)
;; (STATELESS END)
;;; Default setting
(setq user-mail-address "[email protected]"
user-full-name "Giap Tran")
;;; EMAIL 1
(add-to-list 'email-addresses "Giap Tran <[email protected]>")
;; Incomming
(add-to-list 'gnus-secondary-select-methods
'(nnimap "Gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port "imaps")
(nnimap-stream ssl)
(nnimap-authinfo-file "~/.authinfo")))
(add-to-list 'gnus-parameters
'("nnimap.Gmail:.*"
(gcc-self . "nnimap+Gmail:Sent")
(display . all)
(posting-style
(name "Giap Tran")
(address "[email protected]")
(signature-file "~/.mutt/signature.gmail"))
(expiry-target . delete)))
;; Outcomming
(add-to-list 'smtpmail-multi-accounts
'(gmail . ("[email protected]"
"smtp.gmail.com"
587
starttls nil nil nil)))
(add-to-list 'smtpmail-multi-associations '("[email protected]" gmail))
;; Topic
(add-to-list 'topic-topology '(("Gmail" visible nil nil)))
(add-to-list 'topic-alist '("Gmail" ; the key of topic
"nnimap+Gmail:INBOX"
"nnimap+Gmail:Drafts"
"nnimap+Gmail:Sent"))
;;; EMAIL 2
(add-to-list 'email-addresses "Giap TRAN <[email protected]>")
;; Incomming
(add-to-list 'gnus-secondary-select-methods
'(nnimap "Example"
(nnimap-address "imap.example.com")
(nnimap-server-port 993)
(nnimap-stream ssl)
(nnimap-authinfo-file "~/.authinfo")))
(add-to-list 'gnus-parameters
'("nnimap.Example:.*"
(gcc-self . "nnimap+Example:Sent")
(display . all)
(posting-style
(name "Giap TRAN")
(address "[email protected]")
(organization "EXAMPLE VIETNAM")
(signature-file "~/.mutt/signature.example"))
(expiry-target . delete)))
;; Outcomming
(add-to-list 'smtpmail-multi-accounts
'(example . ("[email protected]"
"smtp.example.com"
465
ssl nil nil nil)))
(add-to-list 'smtpmail-multi-associations '("[email protected]" example))
;; Topic
(add-to-list 'topic-topology '(("Example" visible nil nil)))
(add-to-list 'topic-alist '("Example" ; the key of topic
"nnimap+Example:INBOX"
"nnimap+Example:Drafts"
"nnimap+Example:Sent"))
;;; Footer
;; (STATELESS BEGIN)
(add-to-list 'topic-topology '("Gnus" visible))
(eval-after-load 'gnus-topic
'(progn
(setq gnus-topic-topology topic-topology)
(setq gnus-topic-alist topic-alist)))
(setq message-alternative-emails
(regexp-opt email-addresses))
;;; setup message-dont-reply-to-names
(mapc (lambda(arg)
(when (string-match "\\(.+?\\)\<\\(.+?\\)\>" arg)
(add-to-list 'message-dont-reply-to-names (match-string 2 arg)))
) email-addresses)
(defun gnus-message-mail-switching ()
"Switch to another account."
(interactive)
(message-kill-buffer)
(gnus-summary-mail-other-window 1))
(define-key message-mode-map (kbd "C-c f") 'gnus-message-mail-switching)
;; (STATELESS END)
(provide '.gnus)
;;; .gnus ends here