;;; -*-emacs-lisp-*- ;;; ;;; Configuration for VM (setq vm-reply-subject-prefix "Re: ") (setq vm-included-text-prefix "> ") (setq vm-included-text-attribution-format "%F <%f> wrote:\n\n") ;;(setq vm-spool-files '("/home/mdw/Mailbox" ;; "imap:tux.nsict.org:143:inbox:login:mdw:*")) (setq vm-folder-directory "~/Mail/") (setq vm-startup-with-summary t) (setq vm-skip-deleted-messages nil) (setq vm-circular-folders nil) (setq vm-preview-lines nil) (setq vm-highlighted-header-regexp "^From\\|^Subject") (setq vm-delete-after-saving t) (setq vm-move-after-deleting t) (setq vm-delete-empty-folders) (setq vm-mime-qp-encoder-program "mimencode") (setq vm-mime-qp-encoder-switches '("-q")) (setq vm-mime-qp-decoder-program "mimencode") (setq vm-mime-qp-decoder-switches '("-q" "-u")) (setq vm-mime-base64-encoder-program "mimencode") (setq vm-mime-base64-encoder-switches '("-b")) (setq vm-mime-base64-decoder-program "mimencode") (setq vm-mime-base64-decoder-switches '("-b" "-u")) (setq vm-visible-headers '("resent-from:" "from:" "reply-to:" "sender:" "to:" "apparently-to:" "cc:" "subject:" "date:" "delivered-to:" "return-path:")) (setq vm-reply-ignored-addresses '("mdw@excessus\\.demon\\.co\\.uk" "mdw@nsict\\.org" "mdw@eh\\.org" "mdw@ncipher\\.com" "mdw@distorted\\.org\\.uk" "mdw@metalzone\\.distorted\\.org\\.uk" "mwooding@ncipher\\.com" "tux@nsict\\.org")) (defvar mdw-mailing-lists '("hibachi-dealers-members@chiark\\.greenend\\.org\\.uk")) (setq vm-mime-external-content-types-alist '(("image/jpeg" "eog") ("image/jpg" "eog") ("image/gif" "eog") ("image/tiff" "eog"))) (setq vm-url-browser "galeon") (setq vm-frame-parameter-alist '((folder ((width . 80) (height . 33))) (summary ((width . 80) (height . 33))) (primary-summary ((width . 80) (height . 33))) )) (setq vm-auto-folder-alist '(("delivered-to" ("root@" . "admin")))) (defun join-strings (del strings) (with-output-to-string (if (null strings) nil (princ (car strings)) (setq strings (cdr strings)) (while strings (princ del) (princ (car strings)) (setq strings (cdr strings)))))) (defun mdw-vm-fix-mailing-lists () (save-restriction (save-excursion (or (vm-mail-mode-get-header-contents "Resent-To:") (vm-mail-mode-get-header-contents "Resent-Cc:") (vm-mail-mode-get-header-contents "Resent-Bcc:") (let ((mailing-list-regex (concat "\\<\\(" (join-strings "\\|" mdw-mailing-lists) "\\)\\>")) (to (vm-mail-mode-get-header-contents "To:")) (cc (vm-mail-mode-get-header-contents "Cc:"))) (if (or (and to (string-match mailing-list-regex to)) (and cc (string-match mailing-list-regex cc))) (let ((addrs (nconc (and to (vm-parse-addresses to)) (and cc (vm-parse-addresses cc)))) (new nil)) (while addrs (if (string-match mailing-list-regex (car addrs)) (setq new (cons (car addrs) new))) (setq addrs (cdr addrs))) (vm-mail-mode-remove-header "Cc:") (vm-mail-mode-remove-header "To:") (widen) (goto-char (point-min)) (insert (format "To: %s\n" (join-strings ", " new)))))))))) (add-hook 'vm-reply-hook 'mdw-vm-fix-mailing-lists)