Subject: emacs25.1 + gnus, opening message gives: epg-error "no usable configuration" CMS

From: Gijs Hillenius <[email-masked]>
Date: Tue, 18 Oct 2016 15:59:05 +0200

Ted asked me to follow up here, so reposting and edited version of my
question on gnu.emacs.help.

I just started using Debian Emacs 25.1 + Gnus to get to my email. There
is one message that gives an epg-error that I've not seen before, and
eh, it seems neither has Google (except for pointing me to the source
code)..

Following the error, the message is displayed as raw. The message is
displayed normally under Gnus in emacs24: there the message warns:
[[S/MIME Signed Part:Failed]]

The error suggests that I need to change/add settings to my Emacs init.el or
.gnus file? But what?

It Looks like a misconfiguration or bug for handling Apple Mail s/mime
multipart messages

>From my .gnus, s/mime relate settings:

       mm-verify-option 'always
       mm-decrypt-option 'always
       gnus-buttonized-mime-types
       '("multipart/alternative"
         "multipart/encrypted"
         "mul2tipart/signed")

Here is the Backtrace. 

Debugger entered--Lisp error: (epg-error "no usable configuration" CMS)
  signal(epg-error ("no usable configuration" CMS))
  epg-context--make(CMS nil nil nil nil nil nil)
  epg-make-context(CMS)
  mml-smime-epg-verify(((#("multipart/alternative" 0 21 (boundary
"Apple-Mail=athirdrandomnumber" buffer #<buffer *mm*-284343> from
"name@invalid" start nil)) (#<buffer *mm*-592458> ("text/plain"
(charset . "utf-8")) quoted-printable nil ("inline") nil nil nil)
(#("multipart/mixed" 0 15 (boundary "Apple-Mail=_somerandomnumberB"
buffer #<buffer *mm*-435762> from "name@invalid" start nil)) (#<buffer
*mm*-694220> ("text/html" (charset . "utf-8")) quoted-printable nil
nil nil nil nil) (#<buffer *mm*-880244>
("application/vnd.oasis.opendocument.text" (name . "attachmentname")
(x-unix-mode . "0644")) base64 nil ("attachment" (filename
. "attachmentname")) nil nil nil) (#<buffer *mm*-624164> ("text/html"
(charset . "us-ascii")) 7bit nil nil nil nil nil))) (#<buffer
*mm*-696004> ("application/pkcs7-signature" (name . "smime.p7s"))
base64 nil ("attachment" (filename . "smime.p7s")) nil nil nil))
(#("multipart/signed" 0 16 (micalg "sha1" protocol
"application/pkcs7-signature" boundary
"Apple-Mail=anotherrandomnumber" buffer #<buffer *mm*-412231> from
"name@invalid" start nil)) (micalg . "sha1") (protocol
. "application/pkcs7-signature") (boundary
. "Apple-Mail=anotherrandomnumber")))
  mml-smime-verify(((#("multipart/alternative" 0 21 (boundary
"Apple-Mail=athirdrandomnumber" buffer #<buffer *mm*-284343> from
"name@invalid" start nil)) (#<buffer *mm*-592458> ("text/plain"
(charset . "utf-8")) quoted-printable nil ("inline") nil nil nil)
(#("multipart/mixed" 0 15 (boundary "Apple-Mail=_somerandomnumberB"
buffer #<buffer *mm*-435762> from "name@invalid" start nil)) (#<buffer
*mm*-694220> ("text/html" (charset . "utf-8")) quoted-printable nil
nil nil nil nil) (#<buffer *mm*-880244>
("application/vnd.oasis.opendocument.text" (name . "attachmentname")
(x-unix-mode . "0644")) base64 nil ("attachment" (filename
. "attachmentname")) nil nil nil) (#<buffer *mm*-624164> ("text/html"
(charset . "us-ascii")) 7bit nil nil nil nil nil))) (#<buffer
*mm*-696004> ("application/pkcs7-signature" (name . "smime.p7s"))
base64 nil ("attachment" (filename . "smime.p7s")) nil nil nil))
(#("multipart/signed" 0 16 (micalg "sha1" protocol
"application/pkcs7-signature" boundary
"Apple-Mail=anotherrandomnumber" buffer #<buffer *mm*-412231> from
"name@invalid" start nil)) (micalg . "sha1") (protocol
. "application/pkcs7-signature") (boundary
. "Apple-Mail=anotherrandomnumber")))
  mm-possibly-verify-or-decrypt(((#("multipart/alternative" 0 21
(boundary "Apple-Mail=athirdrandomnumber" buffer #<buffer *mm*-284343>
from "name@invalid" start nil)) (#<buffer *mm*-592458> ("text/plain"
(charset . "utf-8")) quoted-printable nil ("inline") nil nil nil)
(#("multipart/mixed" 0 15 (boundary "Apple-Mail=_somerandomnumberB"
buffer #<buffer *mm*-435762> from "name@invalid" start nil)) (#<buffer
*mm*-694220> ("text/html" (charset . "utf-8")) quoted-printable nil
nil nil nil nil) (#<buffer *mm*-880244>
("application/vnd.oasis.opendocument.text" (name . "attachmentname")
(x-unix-mode . "0644")) base64 nil ("attachment" (filename
. "attachmentname")) nil nil nil) (#<buffer *mm*-624164> ("text/html"
(charset . "us-ascii")) 7bit nil nil nil nil nil))) (#<buffer
*mm*-696004> ("application/pkcs7-signature" (name . "smime.p7s"))
base64 nil ("attachment" (filename . "smime.p7s")) nil nil nil))
(#("multipart/signed" 0 16 (micalg "sha1" protocol
"application/pkcs7-signature" boundary
"Apple-Mail=anotherrandomnumber" buffer #<buffer *mm*-412231> from
"name@invalid" start nil)) (micalg . "sha1") (protocol
. "application/pkcs7-signature") (boundary
. "Apple-Mail=anotherrandomnumber")) "name@invalid")
  mm-dissect-multipart((#("multipart/signed" 0 16 (micalg "sha1"
protocol "application/pkcs7-signature" boundary
"Apple-Mail=anotherrandomnumber" buffer #<buffer *mm*-412231> from
"name@invalid" start nil)) (micalg . "sha1") (protocol
. "application/pkcs7-signature") (boundary
. "Apple-Mail=anotherrandomnumber")) "name@invalid")
  mm-dissect-buffer(nil t)
  gnus-display-mime()
  gnus-article-prepare-display()
  gnus-article-prepare(1242 nil)
  gnus-summary-display-article(1242 nil)
  gnus-summary-select-article(nil nil pseudo)
  gnus-summary-scroll-up(1)
  funcall-interactively(gnus-summary-scroll-up 1)
  call-interactively(gnus-summary-scroll-up nil nil)
  command-execute(gnus-summary-scroll-up)