vm, setup: Install movemail-hack, which explicitly nobbles LD_PRELOAD.
[profile] / vm
CommitLineData
f617db13
MW
1;;; -*-emacs-lisp-*-
2;;;
3;;; Configuration for VM
4
370d4c8d
MW
5(let ((path exec-path))
6 (while path
7 (let ((try (expand-file-name "movemail" (car path))))
8 (if (file-executable-p try)
9 (setenv "REAL_MOVEMAIL" try))
10 (setq path (cdr path)))))
11
6b3f86c6
MW
12(setq vm-reply-subject-prefix "Re: "
13 vm-included-text-prefix "> "
14 vm-included-text-attribution-format "%F <%f> wrote:\n\n"
15 vm-folder-directory "~/Mail/"
16 vm-startup-with-summary t
17 vm-skip-deleted-messages nil
18 vm-circular-folders nil
19 vm-preview-lines nil
20 vm-highlighted-header-regexp "^From\\|^Subject"
370d4c8d 21 vm-movemail-program "movemail-hack"
6b3f86c6
MW
22 vm-delete-after-saving t
23 vm-move-after-deleting t
24 vm-delete-empty-folders)
25
26(setq vm-mime-qp-encoder-program "mimencode"
27 vm-mime-qp-encoder-switches '("-q")
28 vm-mime-qp-decoder-program "mimencode"
29 vm-mime-qp-decoder-switches '("-q" "-u")
30 vm-mime-base64-encoder-program "mimencode"
31 vm-mime-base64-encoder-switches '("-b")
32 vm-mime-base64-decoder-program "mimencode"
33 vm-mime-base64-decoder-switches '("-b" "-u"))
34
f617db13
MW
35(setq vm-visible-headers '("resent-from:" "from:" "reply-to:" "sender:"
36 "to:" "apparently-to:" "cc:"
37 "subject:" "date:"
38 "delivered-to:" "return-path:"))
6b3f86c6 39
f617db13
MW
40(setq vm-reply-ignored-addresses '("mdw@excessus\\.demon\\.co\\.uk"
41 "mdw@nsict\\.org" "mdw@eh\\.org"
42 "mdw@ncipher\\.com"
4b05ce02
MW
43 "mwooding@ncipher\\.com"
44 "submit@bugs\\.ncipher\\.com"
45 "mdw@chiark\\.greenend\\.org\\.uk"
f617db13
MW
46 "mdw@distorted\\.org\\.uk"
47 "mdw@metalzone\\.distorted\\.org\\.uk"
f617db13
MW
48 "tux@nsict\\.org"))
49
50(defvar mdw-mailing-lists
51 '("hibachi-dealers-members@chiark\\.greenend\\.org\\.uk"))
52
53(setq vm-mime-external-content-types-alist
4b05ce02
MW
54 '(("image/jpeg" "display")
55 ("image/jpg" "display")
56 ("image/gif" "display")
e4a505a0 57 ("image/bmp" "display")
4b05ce02
MW
58 ("image/tiff" "display")
59 ("application/postscript" "gv")
60 ("application/pdf" "gv")))
f617db13 61
4b05ce02 62(setq vm-url-browser "firefox")
f617db13
MW
63
64(setq vm-frame-parameter-alist
4b05ce02
MW
65 '((folder ((width . 81) (height . 33)))
66 (summary ((width . 81) (height . 33)))
e4a505a0 67 (primary-summary ((width . 81) (height . 33)))))
f617db13
MW
68
69(setq vm-auto-folder-alist
70 '(("delivered-to" ("root@" . "admin"))))
71
f617db13
MW
72(defun join-strings (del strings)
73 (with-output-to-string
74 (if (null strings)
75 nil
76 (princ (car strings))
77 (setq strings (cdr strings))
78 (while strings
79 (princ del)
80 (princ (car strings))
81 (setq strings (cdr strings))))))
cc643e69 82
f617db13
MW
83(defun mdw-vm-fix-mailing-lists ()
84 (save-restriction
85 (save-excursion
86 (or (vm-mail-mode-get-header-contents "Resent-To:")
87 (vm-mail-mode-get-header-contents "Resent-Cc:")
88 (vm-mail-mode-get-header-contents "Resent-Bcc:")
89 (let ((mailing-list-regex (concat "\\<\\("
90 (join-strings "\\|"
91 mdw-mailing-lists)
92 "\\)\\>"))
93 (to (vm-mail-mode-get-header-contents "To:"))
94 (cc (vm-mail-mode-get-header-contents "Cc:")))
95 (if (or (and to (string-match mailing-list-regex to))
96 (and cc (string-match mailing-list-regex cc)))
97 (let ((addrs (nconc (and to (vm-parse-addresses to))
98 (and cc (vm-parse-addresses cc))))
99 (new nil))
100 (while addrs
101 (if (string-match mailing-list-regex (car addrs))
102 (setq new (cons (car addrs) new)))
103 (setq addrs (cdr addrs)))
104 (vm-mail-mode-remove-header "Cc:")
105 (vm-mail-mode-remove-header "To:")
106 (widen)
107 (goto-char (point-min))
108 (insert (format "To: %s\n" (join-strings ", " new))))))))))
109
110(add-hook 'vm-reply-hook 'mdw-vm-fix-mailing-lists)