unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: timotheus <timotheus@tstotts.net>
To: mh-e-devel@lists.sourceforge.net
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: proposed patch to enable MH-E usage of GNU + EPG
Date: Wed, 11 Jul 2007 23:58:56 -0400	[thread overview]
Message-ID: <m2k5t6z30f.fsf@tstotts.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3170 bytes --]


Hi. I would like to make a feature request and also provide the
implementation: that MH-E would support multiple identities using S/MIME
through the most recent GNUs + EasyPG interface. My understanding is
that GNUs 5.11 (cvs) has added support for using EasyPG (library "epg"),
which is eventually to be merged into Emacs CVS.

    http://gnus.org/
    http://www.easypg.org/

In the case of a single identity, installation and configuration of GNUs
5.11 (cvs) to use method 'epg is sufficient.

---- EXAMPLE ----
(setq mml-smime-use 'epg)
(setq mml2015-use 'epg)
(setq pgg-default-scheme 'epg)
---- EXAMPLE ----

The following code will implement MH identity support for this new
epg s/mime functionality without affecting normal GNUs or MML
behavior. It works by use of an identity handler in like fashion to how
MH already supports multiple pgg identities.

My request is that something similar to the following example be added
to `mh-e.el', `mh-mime.el', `mh-identity.el' in the not so distant
future. It is written such that a user could paste it into ~/.emacs and
not have to wait :).

Thanks & regards,
-timotheus

---- EXAMPLE ----
;;;;; MH-E S/MIME identity handling for EasyPG

;;;;; add to mh-e.el
(defvar mh-identity-mml-smime-signers nil
  "Holds list of the S/MIME key ID(s) to be used by mml-smime.el.
This is normally set as part of an Identity in
`mh-identity-list'.")
(make-variable-buffer-local 'mh-identity-mml-smime-signers)

(add-to-list 'mh-identity-handlers
             '(":mml-smime-signers" . mh-identity-handler-smime-identity) t)

;;;;; add to mh-identity.el
(defun mh-identity-handler-smime-identity (field action &optional value)
  "Process header FIELD \":mml-smime-signers\".
The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
The global variable `mh-identity-mml-smime-signers' is set to
VALUE when action 'add is selected."
  (cond
   ((or (equal action 'remove)
        (not value)
        (string= value ""))
    (setq mh-identity-mml-smime-signers nil))
   ((equal action 'add)
    (setq mh-identity-mml-smime-signers (list value))))
  )

;;;;; add to mh-mime.el

;; this advice would be even better to incorporate directly into
;; `mh-mml-to-mime', and it should be straitforward as how to do that:
;;
;;     (let ((saved-text (buffer-string))
;;           (buffer (current-buffer))
;;   -       (modified-flag (buffer-modified-p)))
;;   +       (modified-flag (buffer-modified-p))
;;   +       (mml-smime-signers mh-identity-mml-smime-signers))
;;   +   (message-options-set 'mml-smime-epg-signers nil)
;;       (condition-case err (mml-to-mime)
;;
;;
;; The line:  (message-options-set 'mml-smime-epg-signers nil)
;; is necessary to force MML to scan keys again now that
;; `mml-smime-signers' has been modified. Probably a GNUs (cvs) bug.
;;

(defadvice mh-mml-to-mime (around ad-smime-signers-mh-mml-to-mime activate)
    "Advise `mh-mml-to-mime' to use the MH identity equivalent of
`mml-smime-signers' when calling `mml-to-mime'."
    (let ((mml-smime-signers mh-identity-mml-smime-signers))
      (message-options-set 'mml-smime-epg-signers nil)
      (setq ad-return-value ad-do-it)))

---- EXAMPLE ----

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
mh-e-devel mailing list
mh-e-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mh-e-devel

             reply	other threads:[~2007-07-12  3:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-12  3:58 timotheus [this message]
2007-07-12 21:23 ` proposed patch to enable MH-E usage of GNU + EPG Richard Stallman
2007-07-13  5:31   ` Bill Wohler
2007-07-13 15:14     ` timotheus
2007-07-13 16:13       ` smime.el: security concerns? (was: proposed patch to enable MH-E usage of GNU + EPG) Reiner Steib
2007-07-13 17:09         ` smime.el: security concerns? timotheus
2007-07-13 23:08           ` Richard Stallman
2007-07-13 23:09       ` proposed patch to enable MH-E usage of GNU + EPG Richard Stallman
2007-07-14  0:30         ` timotheus
2007-07-13 23:10     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k5t6z30f.fsf@tstotts.net \
    --to=timotheus@tstotts.net \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=mh-e-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).