all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* proposed patch to enable MH-E usage of GNU + EPG
@ 2007-07-12  3:58 timotheus
  2007-07-12 21:23 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: timotheus @ 2007-07-12  3:58 UTC (permalink / raw)
  To: mh-e-devel; +Cc: ding, emacs-devel


[-- 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-14  0:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-12  3:58 proposed patch to enable MH-E usage of GNU + EPG timotheus
2007-07-12 21:23 ` 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.