Menu

#295 Support S/MIME and EasyPG

mh-e-8.0
open
nobody
patch (25)
5
2016-01-18
2007-07-13
timotheus25
No

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

Discussion

  • timotheus25

    timotheus25 - 2007-07-13

    MH-E EPG S/MIME example

     
  • Bill Wohler

    Bill Wohler - 2011-12-26

    Moving to patches since code is provided. Also, adding a couple of related emails from timotheus which may be helpful:

    To: mh-e-users at lists.sourceforge.net
    From: timotheus <timotheus at tstotts.net>
    Subject: mh-e using smime via gpgsm
    Date: Wed, 11 Jul 2007 14:51:29 -0400
    User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)
    Cc: info-gnus-english at gnu.org
    Message-ID: <m2ir8qrcy6.fsf@tstotts.net>

    [[PGP Signed Part:Undecided]]

    Hi.

    Just a note for others who read this list. It took me a very long time
    to find a simple solution for integrating real gpgsm support into MH-E,
    without writing my own library.

    I found that since the GNUs CVS head now supports using easypg for PGP
    and SMIME via `gpg' and `gpgsm', so does MH-E with the right
    configuration.

    EXAMPLE:

    ;; verify and decrypt
    (setq mm-verify-option 'always)
    (setq mm-decrypt-option 'always)

    ;; use EPA/EPG if available
    (setq mml-smime-use (cond ((and (locate-library "epa") (locate-library "epg")) 'epg)
    (t 'openssl)))

    (defun timotheus-change-mh-mml-method-default-pgpmime ()
    (interactive)
    (setq mh-mml-method-default "pgpmime"))

    (defun timotheus-change-mh-mml-method-default-smime ()
    (interactive)
    (setq mh-mml-method-default "smime"))

    (defadvice mh-letter-mode (after timotheus-mh-letter-mode activate)
    "Add some key strokes."
    (local-set-key (kbd "C-c RET 1") 'timotheus-change-mh-mml-method-default-pgpmime)
    (local-set-key (kbd "C-c RET 2") 'timotheus-change-mh-mml-method-default-smime))

    Regards,
    -timotheus

    [[End of PGP Signed Part]]

    To: mh-e-devel at lists.sourceforge.net
    From: timotheus <timotheus at tstotts.net>
    Subject: Re: proposed patch to enable MH-E usage of GNU + EPG
    Date: Fri, 13 Jul 2007 11:14:25 -0400
    User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)
    Cc: ding at gnus.org, emacs-devel at gnu.org
    Message-ID: <m23azscp4e.fsf@tstotts.net>

    [[PGP Signed Part:Undecided]]
    Bill Wohler <wohler at newt.com> writes:

    > Thanks very much timotheus. I haven't yet heard of EPG and will make a
    > note to read up on it. I am extremely pleased that we'll be able to
    > provide S/MIME support in the future. In the meantime, would you be
    > kind enough to report your request and code to SourceForge so that we
    > can track it?

    You're welcome. Added to sourceforge. FYI, MH-E of the Emacs CVS head
    already supports S/MIME through the `smime.el' library that uses
    openssl. Remember that MH-E uses Gnus MML to provide the security. You
    just change the default MML method to "smime" instead of
    "pgpmime". However, multiple identity support is lacking, and `smime.el'
    has some security, feature, and ease-of-use concerns too.

    This is not the only feature I've added to MH-E / MM locally for my own
    personal use. Some of these include:
    - proper LDAP email lookup and expansion via EUDC
    - scale-down of large inline images to fit current buffer window
    size; works with Unicode and HTML buffers too!
    - key strokes to switch between smime/pgpmime
    - identity handler for auto signing, different method for each
    - inherit lpr command from `lpr.el'
    - auto-view of PDF, DOC, etc. inline

    If you or users want to poke around:
    http://tstotts.net/pubvc.co/elisp-snippets/
    http://tstotts.net/pubvc.co/elisp-snippets/set-mh-e.el

    > Richard Stallman <rms at gnu.org> writes:
    >
    >> Please do not make MH-E use EPG until EPG is _actually installed_ in
    >> Emacs.
    >
    > There is certainly no harm in making it aware of EPG, if it is
    > available. MH-E has quite a bit of precedent of being able to handle
    > packages if they are installed, but otherwise ignore them. I'm
    > assuming furthermore that EPG is free and there won't be any problem
    > referring to it in MH-E. Yes? However, I agree that MH-E should not
    > use send EPG by default until it is installed in Emacs.
    >
    >> "There's many a slip twixt the cup and the lip."
    >
    > ;-). Playing your gamelan tonight, Richard?

    I concur with Stallman's concern. The Gnus I referred to is Gnus 5.11
    (cvs), which now appears to be named No Gnus, current snapshot is
    version 0.6. (My code requires the head CVS - 0.7.) Perhaps you can call
    this alpha software. You'll note the comments in my example work around
    a No Gnus "bug" present in this functionality.

    Earlier I read a thread between some combination of EasyPG, Gnus devs,
    and/or Stallman -- I don't recall. The general impression was that `epg'
    just might replace `pgg' altogether in the future;
    code/decisions/interfaces are in flux... etc.

    Mostly I hope that MH-E will add this feature soon after No Gnus
    reaches a beta/merge/release state :-). Before-hand could be premature,
    IMHO.

    Regards,
    -timotheus

    [[End of PGP Signed Part]]

     
  • Bill Wohler

    Bill Wohler - 2011-12-26
    • summary: request: multi S/MIME identity via EasyPG --> Support S/MIME and EasyPG
    • labels: 311939 -->
     
  • Bill Wohler

    Bill Wohler - 2011-12-26
    • milestone: --> mh-e-8.0
     
  • Bill Wohler

    Bill Wohler - 2013-02-23
    • labels: --> patch
     
  • Bill Wohler

    Bill Wohler - 2013-02-23

    Ticket moved from /p/mh-e/patches/13/

     
  • Bill Wohler

    Bill Wohler - 2013-02-23
    • Status: open --> unread
     
  • Bill Wohler

    Bill Wohler - 2016-01-18
    • status: unread --> open
     

Log in to post a comment.

MongoDB Logo MongoDB