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 (defun mc-wl-decrypt-message
()
42 ; (wl-summary-enter-handler)
43 (save-window-excursion
44 (wl-summary-jump-to-current-message)
47 (eval-after-load "mailcrypt"
51 ((wl-draft-mode (encrypt . mc-encrypt-message
)
52 (sign . mc-sign-message
))
53 (wl-summary-mode (decrypt . mc-wl-decrypt-message
)
54 (verify . mc-wl-verify-signature
))))
56 (add-hook 'wl-summary-mode-hook
57 ;; Set keybindings for
60 (local-set-key "k" 'mc-wl-decrypt-message
)
61 (local-set-key "0" 'mc-wl-verify-signature
)
62 (local-set-key "X" '(lambda ()
63 ; checks for mail remotely using rsync.
66 (concat (expand-file-name "~/software/mail/getmail.sh") " > /dev/null 2>&1"))
67 (wl-summary-incorporate)
70 (defun gpcf-decrypt-mail
()
71 "Decrypts mail in MIME preview buffer. Works with both PGP/MIME
78 ((search-forward "<application/pgp-encrypted" nil t
)
79 (let ((id "") (mess ""))
80 (save-window-excursion
81 (mime-preview-extract-current-entity)
82 (when (string-match "-[0-9]+" (buffer-name))
83 (setq id
(substring (buffer-name) (match-beginning 0) (match-end 0)))
86 (save-window-excursion
87 (switch-to-buffer (concat "*Preview- *WL:Message*" id
"*"))
88 (let ((temp-point (point)))
90 (setq mess
(buffer-substring temp-point
(point)))
93 (let ((temp-point (point)) (inhibit-read-only t
))
94 (search-backward "This part is encrypted" nil t
)
95 (delete-region (point) temp-point
)
99 ((search-forward "-----BEGIN PGP MESSAGE-----" nil t
)
100 (let ((inhibit-read-only t
))
102 (t (error "No GPG encrypted message found in this file."))))
105 (autoload 'sm-add-emacs-name
"silly-mail" nil t
)
106 (defun gpcf-setup-mail
()
107 "This function prepares the draft mode.
108 It add headers and defines keyboard shortcuts. Before the
109 message is sent, it adds the user's signature."
110 (if (string= "*draft*" (buffer-name))
112 (setq enc-color
(face-remap-add-relative 'mode-line
:background
"dark red"))
113 (set-input-method "TeX")
114 (sm-add-emacs-name) ;; add silly headers
116 (sm-put-header "X-PGP-Key" "http://gpcf.eu/key.asc")
117 (local-set-key (kbd "C-c e") '(lambda ()
119 (mime-edit-set-encrypt t
)
120 (mime-edit-set-sign t
)
122 "This message will be signed and encrypted")
123 (face-remap-remove-relative enc-color
)
125 (local-set-key (kbd "C-c s") 'ispell-message
)
126 (local-set-key (kbd "C-c c") '(lambda ()
127 ;;; save email to queue and send it using SSH.
129 (wl-draft-send-and-exit)
130 (call-process-shell-command
131 (concat (expand-file-name "~/software/mail/sendmail.sh") "&")
134 (delete-other-windows))
135 (mail-signature) ;; add signature
138 (add-hook 'mime-edit-mode-hook
'gpcf-setup-mail
)
139 ; single window mode.
140 (setq wl-stay-folder-window nil
141 wl-draft-use-frame nil
142 wl-summary-move-order
'unread
144 ;; Prevent wl from splitting large messages
145 (setq mime-edit-split-message nil
)
147 ;; my E-Mail addresses:
148 (setq wl-user-mail-address-list
'("gabriel@gpcf.eu"
150 (setq wl-summary-showto-folder-regexp
".*sent.*")
153 (load "~/.emacs.d/files/refile-rules.el")