· 7 years ago · Nov 26, 2018, 06:58 PM
1;; mode:-*-emacs-lisp-*-
2;; wanderlust settings
3
4(setq elmo-maildir-folder-path "~/Mail" ;; where i store my mail
5 wl-stay-folder-window t ;; show the folder pane (left)
6 wl-folder-window-width 25 ;; toggle on/off with 'i'
7 wl-fcc-force-as-read t ;; mark send messages as read
8 wl-draft-folder ".Wunki/Drafts"
9 wl-default-folder ".Wunki/Inbox"
10 wl-queue-folder ".Wunki/Queue"
11 wl-temporary-file-directory "~/.tmp/"
12 wl-user-mail-address-list (quote ("petar@wunki.org" "petar@breadandpepper.com")))
13
14;; send mail with msmtp
15(setq wl-draft-send-mail-function 'sendmail-send-it
16 sendmail-program "/usr/bin/msmtpq"
17 message-send-mail-function 'message-send-mail-with-sendmail
18 mail-specify-envelope-from t
19 message-sendmail-f-is-evil nil
20 mail-envelope-from 'header
21 mail-interactive nil
22 message-sendmail-envelope-from 'header)
23
24;; templates
25(setq wl-template-alist
26 '(("default"
27 (wl-from . "Petar Radosevic <petar@wunki.org>")
28 ("From" . wl-from)
29 (signature-file-name . "~/.signature-wunki")
30 (wl-smtp-posting-user . "petar@wunki.org")
31 (wl-smtp-posting-server . "messagingengine.com")
32 (wl-local-domain . "wunki.org")
33 (wl-message-id-domain . "messagingengine.com")
34 ("Fcc" . ".Wunki/Sent")
35 (wl-draft-folder . ".Wunki/Drafts")
36 (wl-trash-folder . ".Wunki/Trash")
37 (wl-queue-folder . ".Wunki/Queue"))
38
39 ("bread-and-pepper"
40 (wl-from . "Petar Radosevic <petar@breadandpepper.com>")
41 ("From" . wl-from)
42 (signature-file-name . "~/.signature-bp")
43 (wl-smtp-posting-user . "petar@breadandpepper.com")
44 (wl-smtp-posting-server . "gmail.com")
45 (wl-local-domain . "breadandpepper.com")
46 (wl-message-id-domain . "gmail.com")
47 ("Fcc" . ".Bread & Pepper/Sent")
48 (wl-draft-folder . ".Bread & Pepper/Drafts")
49 (wl-trash-folder . ".Bread & Pepper/Trash")
50 (wl-queue-folder . ".Bread & Pepper/Queue"))))
51
52;; automatically select the correct template based on which folder I'm visiting
53(setq wl-draft-config-matchone t)
54
55;; choose the correct template
56(setq wl-draft-config-alist
57 '(((string-match ".*Wunki" wl-draft-parent-folder)
58 (template . "default"))
59 ((string-match ".*Bread" wl-draft-parent-folder)
60 (template . "bread-and-pepper"))))
61
62;; delete messages
63(setq wl-dispose-folder-alist
64 '((".*Trash" . remove)
65 (".*Junk" . remove)
66 (".*Bread.*" . ".Bread & Pepper/Trash")
67 (".*Wunki.*" . ".Wunki/Trash")))
68
69;; hide many fields from message buffers
70(setq wl-message-ignored-field-list '("^.*:")
71 wl-message-visible-field-list
72 '("^\\(To\\|Cc\\):"
73 "^Subject:"
74 "^\\(From\\|Reply-To\\):"
75 "^Organization:"
76 "^Message-Id:"
77 "^\\(Posted\\|Date\\):")
78 wl-message-sort-field-list
79 '("^From"
80 "^Organization:"
81 "^X-Attribution:"
82 "^Subject"
83 "^Date"
84 "^To"
85 "^Cc"))
86
87;; Apply wl-draft-config-alist as soon as you enter in a draft buffer. Without
88;; this wanderlust would apply it only when actually sending the e-mail.
89(add-hook 'wl-mail-setup-hook 'wl-draft-config-exec)
90
91;; choose the correct send method
92(defun choose-msmtp-account ()
93 (setq message-sendmail-extra-arguments (if (equal "petar@wunki.org" wl-smtp-posting-user)
94 '("-a" "wunki")
95 '("-a" "breadandpepper"))))
96(add-hook 'wl-draft-send-hook 'choose-msmtp-account)
97
98;; cycle through templates with arrow keys
99(define-key wl-template-mode-map (kbd "<right>") 'wl-template-next)
100(define-key wl-template-mode-map (kbd "<left>") 'wl-template-prev)