encryption & decryption troubles

48 views
Skip to first unread message

Charles-H. Schulz

unread,
Jun 19, 2016, 4:18:13 AM6/19/16
to mu-di...@googlegroups.com
Hi,

Ever since I've been using mu4e the only thing that I never got to work properly is the ability to decrypt and encrypt message. The way this is supposed to function is by relying on the epa/epg emacs component, which makes total sense. However I have two specific issues with that.

It may seem stupid but I either do not know how to enable epa automatically at emacs startup, or something's wrong with my configuration. The way it works however, is that when using ERC (the main IRC mode) epa is properly called and activated. I can then encrypt and decrypt messages. I'm not sure why this is so. Calling 'epa-mail-mode' does not seem to do the trick either.

The second issue is a bit different but is related. I can encrypt messages perfectly once epa has been loaded. But when receiving encrypted messages it decrypts them, but the gpg/MIME method leaves me with a message that has one or two attachments (two if it is signed) that I'm not able to open.

Any pointers to any of these issues are highly welcome.

Thanks,

Charles.

Foivos S. Zakkak

unread,
Jul 12, 2016, 8:24:38 AM7/12/16
to mu-di...@googlegroups.com
Hi there,

I am appending my encryption related configuration, which seems to work
in most cases:

--8<---------------cut here---------------start------------->8---
(use-package mml-sec
:ensure nil
:functions (mml-secure-message-sign-pgpmime
mml-secure-message-encrypt-pgpmime))

(require `epg-config)
(setq mail-user-agent 'mu4e-user-agent
mml2015-verbose t
mml2015-use 'epg
mml2015-encrypt-to-self t
mml2015-sign-with-sender t

;; Use smime?
;; mml-default-encrypt-method "smime"
;; mml-smime-use 'epg

gnus-message-replyencrypt t
gnus-message-replysign t
gnus-message-replysignencrypted t
gnus-treat-x-pgp-sig t

mm-verify-option 'always
mm-decrypt-option 'always

;; epg-debug t ; then read the *epg-debug*" buffer
)

;; also, make sure the gnutls command line utils are installed
;; package 'gnutls-bin' in Debian/Ubuntu
--8<---------------cut here---------------end--------------->8---

Foivos
--
PGP: 7B40 69D9 29BA AE91 C0B3 220A 0846 BFD1 03F0 4EA1
signature.asc

Charles-H. Schulz

unread,
Jul 14, 2016, 10:33:38 AM7/14/16
to mu-di...@googlegroups.com
Hello Foivos,

Thanks. However since I don't use 'use-package and use (require 'mml-sec) instead I've encountered an issue with :ensure and :functions as the function is deemed void when evaluated. Any idea how to turn this into something more traditional such as setq... something?

Thanks,

Charles.

--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Foivos S. Zakkak

unread,
Jul 14, 2016, 2:40:45 PM7/14/16
to mu-di...@googlegroups.com
Hi Charles,

I think you don't need to worry about any of them.

`:ensure` is used to tell use-package which elpa package provides this
package.

`:functions` essentially tells the compiler that this package provides
the listed functions.

Try to drop them altogether and see if you have any issues.

Kind regards,
Foivos
signature.asc

Charles-H. Schulz

unread,
Jul 14, 2016, 4:07:33 PM7/14/16
to mu-di...@googlegroups.com
Thanks! Indeed the eval is correct now. Unfortunately, only half of the job is done: When signing & encrypting a message I now get the key password prompt but when sending it I get the message that epg has not been enabled. Yet I thought it was. What's the difference between epa (and the epa commands) and epg then?

Best,

Charles.

Foivos S. Zakkak

unread,
Jul 14, 2016, 4:15:45 PM7/14/16
to mu-di...@googlegroups.com
To be honest I am not aware of the differences between epg and epa.
It's been a long time since I researched on this topic.

How do you first sign/encrypt the message and then send it?

I use the following hook to sign/encrypt and send my messages.

--8<---------------cut here---------------start------------->8---
;; Set my default context
(mu4e-context-switch nil "Gmail")

;; PGP-Sign or Encrypt all e-mails
(defun my-mu4e-sign-or-encrypt ()
(let ((choice
(mu4e-read-option
" Send mail "
`( (,"signed" . signed)
(,"encrypted" . encrypted)
("plain" . plain)))))
(cond
((eq choice 'signed)
(mml-secure-message-sign-pgpmime))
((eq choice 'encrypted)
(mml-secure-message-encrypt-pgpmime))
(t ()))
))
(add-hook 'message-send-hook 'my-mu4e-sign-or-encrypt)
--8<---------------cut here---------------end--------------->8---

Regards,
Foivos
signature.asc
Reply all
Reply to author
Forward
0 new messages