Emacs with Wanderlust and GPG

Last edited

Use Wanderlust to encrypt and decrypt messages

Wanderlust is the IMAP mailclient for Emacs. With the help of mailcrypt, Wanderlust can encrypt and decrypt messages through GnuPG (sometimes called openpgp).


If you already haven't done so, install the GNU Privacy Guard (GnuPG). Your distribution almost certainly comes with a gpg package.

Get Mailcrypt

Mailcrypt makes the use of gpg within Emacs easy.

Setup .emacs

To prevent mailcrypt complain about the read only message buffer some tinkering have to be done to your .emacs file. After some googlesearches I found the following to work:

(require 'mailcrypt)
(add-hook 'wl-summary-mode-hook 'mc-install-read-mode)
(add-hook 'wl-mail-setup-hook 'mc-install-write-mode)

(defun mc-wl-verify-signature ()

(defun mc-wl-decrypt-message ()
    (let ((inhibit-read-only t))

(eval-after-load "mailcrypt"
  '(setq mc-modes-alist
         ((wl-draft-mode (encrypt . mc-encrypt-message)
            (sign . mc-sign-message))
          (wl-summary-mode (decrypt . mc-wl-decrypt-message)
            (verify . mc-wl-verify-signature))))

Encrypt message in Wanderlust

To encrypt a message, call M-x mc-encrypt.

Decrypt messages in Wanderlust

To decrypt a message, call M-x mc-wl-decrypt-message from the summary-buffer. You will be prompted for your password and the message will be decrypted.

Use Wanderlust and GMail to send and receive encrypted email

Now you have set up Wanderlust to send and receive encrypted email. It is very easy to use Wanderlust with GMail. So now you can use Wanderlust to send and receive encrypted email from your GMail account.