1 ;; mode: -*-emacs-lisp-*-
3 (setq wl-stay-folder-window t
4 wl-local-domain
"gpcf.eu"
5 wl-message-id-domain
"aubergine.gpcf.eu"
6 wl-from
(concat user-full-name
" <" user-mail-address
">")
7 ;; here starts all the maildir stuff
8 elmo-maildir-folder-path
"~/Maildir"
10 wl-trash-folder
".trash"
11 wl-queue-folder
".queue"
12 signature-file-name
"~/.signature"
13 signature-insert-at-eof t
14 signature-delete-blank-lines-at-eof t
15 wl-draft-send-mail-function
'wl-draft-send-mail-with-sendmail
16 sendmail-program
(expand-file-name "~/software/mail/savemail.py")
17 default-mime-charset
'utf8
18 wl-fcc-force-as-read t
19 wl-interactive-send nil
22 (setq mime-edit-insert-user-agent-field nil
)
24 (setq wl-generate-mailer-string-function
28 (format "GNU Emacs Version 24.3, %s, GNU/Linux" (product-string-1 'wl-version
)))))
30 (setq wl-demo-display-logo nil
)
31 (mc-install-read-mode)
34 (defun mc-wl-verify-signature
()
36 (save-window-excursion
37 (wl-summary-jump-to-current-message)
40 (eval-after-load "mailcrypt"
44 ((wl-draft-mode (encrypt . mc-encrypt-message
)
45 (sign . mc-sign-message
))
46 (wl-summary-mode (decrypt . mc-wl-decrypt-message
)
47 (verify . mc-wl-verify-signature
))))
49 (add-hook 'wl-summary-mode-hook
50 ;; Set keybindings for
53 (local-set-key "k" '(lambda ()
55 (save-window-excursion
56 (wl-summary-jump-to-current-message)
57 (gpcf-decrypt-mail))))
58 (local-set-key "0" 'mc-wl-verify-signature
)
59 (local-set-key "X" '(lambda ()
60 ; checks for mail remotely using rsync.
63 (concat (expand-file-name "~/software/mail/getmail.sh") " > /dev/null 2>&1"))
64 (wl-summary-incorporate)
67 (defun gpcf-decrypt-mail
()
68 "Decrypts mail in MIME preview buffer. Works with both PGP/MIME
75 ((search-forward "<application/pgp-encrypted" nil t
)
76 (let ((id "") (mess ""))
77 (save-window-excursion
78 (mime-preview-extract-current-entity)
79 (when (string-match "-[0-9]+" (buffer-name))
80 (setq id
(substring (buffer-name) (match-beginning 0) (match-end 0)))
83 (save-window-excursion
84 (switch-to-buffer (concat "*Preview- *WL:Message*" id
"*"))
85 (let ((temp-point (point)))
87 (setq mess
(buffer-substring temp-point
(point)))
90 (let ((temp-point (point)) (inhibit-read-only t
))
91 (search-backward "This part is encrypted" nil t
)
92 (delete-region (point) temp-point
)
96 ((search-forward "-----BEGIN PGP MESSAGE-----" nil t
)
97 (let ((inhibit-read-only t
))
99 (t (error "No GPG encrypted message found in this file."))))
102 (autoload 'sm-add-emacs-name
"silly-mail" nil t
)
103 (defun gpcf-setup-mail
()
104 "This function prepares the draft mode.
105 It add headers and defines keyboard shortcuts. Before the
106 message is sent, it adds the user's signature."
107 (if (string= "*draft*" (buffer-name))
109 (setq enc-color
(face-remap-add-relative 'mode-line
:background
"dark red"))
110 (set-input-method "TeX")
111 (sm-add-emacs-name) ;; add silly headers
113 (sm-put-header "X-PGP-Key" "http://gpcf.eu/key.asc")
114 (local-set-key (kbd "C-c e") '(lambda ()
116 (mime-edit-set-encrypt t
)
117 (mime-edit-set-sign t
)
119 "This message will be signed and encrypted")
120 (face-remap-remove-relative enc-color
)
122 (local-set-key (kbd "C-c s") 'ispell-message
)
123 (local-set-key (kbd "C-c c") '(lambda ()
124 ;;; save email to queue and send it using SSH.
126 (wl-draft-send-and-exit)
127 (call-process-shell-command
128 (concat (expand-file-name "~/software/mail/sendmail.sh") "&")
131 (delete-other-windows))
132 (mail-signature) ;; add signature
135 (add-hook 'mime-edit-mode-hook
'gpcf-setup-mail
)
136 ; single window mode.
137 (setq wl-stay-folder-window nil
138 wl-draft-use-frame nil
139 wl-summary-move-order
'unread
141 ;; Prevent wl from splitting large messages
142 (setq mime-edit-split-message nil
)
144 ;; my E-Mail addresses:
145 (setq wl-user-mail-address-list
'("gabriel@gpcf.eu"
147 (setq wl-summary-showto-folder-regexp
".*sent.*")
150 (load "~/.emacs.d/files/refile-rules.el")