aboutsummaryrefslogtreecommitdiff
path: root/.vm
blob: f9fe5abcaba9f121222c9b43acb592cd5b76d252 (plain) (blame)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
;; -*- Emacs-Lisp -*-

(setq vm-imap-account-alist
      '(
	("imap:localhost:143:*:login:ryan:*" "local")
	("imap-ssl:imap.google.com:993:*:login:ryanakca:*" "gmail")
	)
      )

(setq vm-primary-inbox "imap:localhost:143:INBOX:login:ryan:*")

; Setup coloring
(require 'u-vm-color)
(add-hook 'vm-select-message-hook 'u-vm-color-fontify-buffer)
(add-hook 'vm-summary-mode-hook 'u-vm-color-summary-mode)
(defadvice vm-fill-paragraphs-containing-long-lines
              (after u-vm-color activate)
              (u-vm-color-fontify-buffer))
(defadvice vm-show-current-message (after u-vm-color activate)
    (u-vm-color-fontify-buffer-even-more))
(defadvice vm-decode-mime-message (after u-vm-color activate)
    (u-vm-color-fontify-buffer-even-more))

;; fill paragraphs to 72 chars
(setq vm-fill-paragraphs-containing-long-lines-in-reply 72)
(setq vm-word-wrap-paragraphs-in-reply t)

; Setup a shortcut to the whole visit-imap-folder nonsense
(defalias 'imap 'vm-visit-imap-folder)

; Keep the -> line centered
(setq vm-auto-center-summary t)

; Enable multiple sender profiles
(require 'vm-pcrisis)
(vmpc-my-identities "rak@debian.org" "ryanakca@gmail.com"
		    "ryan.kavanagh@queensu.ca" "9rak@queensu.ca"
                    "ryanakca@kubuntu.org" "ryanakca@ubuntu.com"
		    "ryan@cs.queensu.ca" "ryank@cs.mcgill.ca"
		    "ryan.kavanagh@mail.mcgill.ca")

(setq vmpc-conditions
      '( ("QueensU"
	  (vmpc-folder-match ".*QueensU.*") )
	 ("To Debian"
	  (vmpc-header-match "To" ".*debian.org") )
	 ("To Queensu"
	  (vmpc-header-match "To" ".*@queensu.ca") )
	 ("To Ubuntu"
	  (vmpc-header-match "To" ".*@ubuntu.com") )
	 ("To Kubuntu"
	  (vmpc-header-match "To" ".*@kubuntu.org") )
	 ("default"
	  (vmpc-none-true-yet) )
	 ) )

(setq vmpc-actions
      '( ("From Queens"
	  (vmpc-composition-buffer
	    (setq user-mail-address "ryan.kavanagh@queensu.ca")
            (setq sendmail-program "~/bin/msmtp/msmtp-queensu")
	    (setq vm-mail-fcc "local:QueensU.Sent Items") )
	  (vmpc-substitute-header "From" "Ryan Kavanagh <ryan.kavanagh@queensu.ca>") )
	 ("From Queens CS"
          (vmpc-composition-buffer
	   (setq user-mail-address "ryan@cs.queensu.ca")
           (setq sendmail-program "~/bin/msmtp/msmtp-queensucs")
	   (setq vm-mail-fcc nil) )
	  (vmpc-substitute-header "From" "Ryan Kavanagh <ryan@cs.queensu.ca>") )
	 ("From Debian"
          (vmpc-composition-buffer
            (setq user-mail-address "rak@debian.org")
	    (setq sendmail-program "~/bin/msmtp/msmtp-default")
            (setq vm-mail-fcc nil) )
	  (vmpc-substitute-header "From" "Ryan Kavanagh <rak@debian.org>") )
	 ("From Ubuntu"
	  (vmpc-composition-buffer
	   (setq user-mail-address "ryanakca@ubuntu.com")
	   (setq sendmail-program "~/bin/msmtp/msmtp-ubuntu")
           (setq vm-mail-fcc nil) )
	  (vmpc-substitute-header "From" "Ryan Kavanagh <ryanakca@ubuntu.com") )
         ("From Kubuntu"
          (vmpc-composition-buffer
           (setq user-mail-address "ryanakca@kubuntu.org")
           (setq sendmail-program "~/bin/msmtp/msmtp-kubuntu")
           (setq vm-mail-fcc nil) )
	  (vmpc-substitute-header "From" "Ryan Kavanagh <ryanakca@kubuntu.org") )
         ("prompt"
	  (vmpc-prompt-for-profile) )
	 ) )

;; Fallback rules
(setq vmpc-default-rules
      '( ("QueensU" "From Queens")
	 ("ToDeb" "From Debian")
	 ("default" "From Debian")
	 ) )

;; Rules for mail created with vm-mail
(setq vmpc-newmail-rules vmpc-default-rules)
;; Rules for mail created with vm-mail-from-folder
(setq vmpc-mail-rules vmpc-default-rules)
;; Rules for mail created with vm-reply
(setq vmpc-reply-rules
      '( ("To Debian" "From Debian")
	 ("To Queensu" "From Queens")
	 ("To Ubuntu" "From Ubuntu")
	 ("To Kubuntu" "From Kubuntu")
	 ) )

;; Store login info in .authinfo.gpg
(require 'auth-source)

;; Display whole message, require <SPC> to mark as read
(setq vm-preview-lines t)

;; bind ! to flag a message
(define-key vm-mode-map "!" 'vm-toggle-flag-message)
;; We'll always be saving to an imap server
(define-key vm-mode-map "s" 'vm-save-message-to-imap-folder)
;; We'll always be switching to an imap server
(define-key vm-mode-map "v" 'vm-visit-imap-folder)

;; assume we're saving to the same imap server
(setq vm-imap-save-to-server t)

;; delete a message after saving it
(setq vm-delete-after-saving t)

;; move to the next message after deleting
(setq vm-move-after-deleting t)

;; move to the next message after reading
(setq vm-move-after-reading t)

;; ask before creating a new folder to save to
(setq vm-confirm-new-folders t)

;; Automatically verify mime signatures
(setq vm-mime-verify-signatures t)

;; Ident threads
(setq-default vm-summary-show-threads t)

;; Don't try to load entire messages into memory at startup.
(setq vm-enable-external-messages '(imap))
(setq vm-imap-max-message-size 0)

;; Set attribution format
(setq vm-included-text-attribution-format "On %w, %m %2d, %y at %h %z, %F wrote:
")

;; Prefix included text by "> "
(setq vm-included-text-prefix "> ")

;;  include text in reply
(setq vm-include-text-basic t)

;; summary format
(setq vm-summary-format "%n %*%a %-17.17F %2y %-3.3m %2d (%-4l) %4l/%-5c %I\"%s\"
")

;; BBDB
(require 'bbdb)
(bbdb-initialize 'vm)
(setq bbdb-send-mail-style 'vm)
(add-hook 'vm-reply-hook 'bbdb-force-record-create)

;; signature
(setq mail-signature t)
(setq mail-signature-file "~/.signature")

;; gpg?
(require 'vm-pgg)
; prompt for signing
(add-hook 'vm-mail-send-hook 'vm-pgg-ask-hook t)

;; vim: set filetype=lisp: