3 ;;; Configuration for VM
5 (let ((path exec-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)))))
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
20 vm-highlighted-header-regexp "^From\\|^Subject"
21 vm-movemail-program "movemail-hack"
22 vm-delete-after-saving t
23 vm-move-after-deleting t
24 vm-delete-empty-folders)
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"))
35 (setq vm-visible-headers '("resent-from:" "from:" "reply-to:" "sender:"
36 "to:" "apparently-to:" "cc:"
38 "delivered-to:" "return-path:"))
40 (setq vm-reply-ignored-addresses '("mdw@excessus\\.demon\\.co\\.uk"
41 "mdw@nsict\\.org" "mdw@eh\\.org"
43 "mwooding@ncipher\\.com"
44 "submit@bugs\\.ncipher\\.com"
45 "mdw@chiark\\.greenend\\.org\\.uk"
46 "mdw@distorted\\.org\\.uk"
47 "mdw@metalzone\\.distorted\\.org\\.uk"
50 (defvar mdw-mailing-lists
51 '("hibachi-dealers-members@chiark\\.greenend\\.org\\.uk"))
53 (setq vm-mime-external-content-types-alist
54 '(("image/jpeg" "display")
55 ("image/jpg" "display")
56 ("image/gif" "display")
57 ("image/bmp" "display")
58 ("image/tiff" "display")
59 ("application/postscript" "gv")
60 ("application/pdf" "gv")))
62 (setq vm-url-browser "firefox")
64 (setq vm-frame-parameter-alist
65 '((folder ((width . 81) (height . 33)))
66 (summary ((width . 81) (height . 33)))
67 (primary-summary ((width . 81) (height . 33)))))
69 (setq vm-auto-folder-alist
70 '(("delivered-to" ("root@" . "admin"))
71 ("from" ("Cron Daemon" . "admin"))))
73 (defun join-strings (del strings)
74 (with-output-to-string
78 (setq strings (cdr strings))
82 (setq strings (cdr strings))))))
84 (defun mdw-vm-fix-mailing-lists ()
87 (or (vm-mail-mode-get-header-contents "Resent-To:")
88 (vm-mail-mode-get-header-contents "Resent-Cc:")
89 (vm-mail-mode-get-header-contents "Resent-Bcc:")
90 (let ((mailing-list-regex (concat "\\<\\("
94 (to (vm-mail-mode-get-header-contents "To:"))
95 (cc (vm-mail-mode-get-header-contents "Cc:")))
96 (if (or (and to (string-match mailing-list-regex to))
97 (and cc (string-match mailing-list-regex cc)))
98 (let ((addrs (nconc (and to (vm-parse-addresses to))
99 (and cc (vm-parse-addresses cc))))
102 (if (string-match mailing-list-regex (car addrs))
103 (setq new (cons (car addrs) new)))
104 (setq addrs (cdr addrs)))
105 (vm-mail-mode-remove-header "Cc:")
106 (vm-mail-mode-remove-header "To:")
108 (goto-char (point-min))
109 (insert (format "To: %s\n" (join-strings ", " new))))))))))
111 (add-hook 'vm-reply-hook 'mdw-vm-fix-mailing-lists)