pgp/mime support in gpg

Janusz A. Urbanowicz alex at
Fri May 5 14:31:29 CEST 2006

On Thu, May 04, 2006 at 11:29:16AM +0100, Nicholas Cole wrote:
> Just a thought.  Would it not be very helpful for
> plugin writers if the gpg binary was able to generate
> pgp/mime emails?

> What I have in mind is a flag like --email which would
> alter encryption/decryption/signing operations so that
> an email was expected as input, and the
> encrypted/decrypted email given as output.  Recipient
> lists could still be specified explicitly, but it
> would mean that the plugin writer would only have to
> deal with the work of managing keys etc., not the work
> of mangling the message to comply with the pgp/mime
> spec.

In the scheme you propose, GPG would have to:

1) parse MIME structure of the message that it is passed
2) do proper decoding/encoding of parts that may be mangled in transit
3) sign/encrypt

then the MUA

4 has to MIME-parse the result and put it in its own data structures
in place of the original message.

From the design point of view, 4 is redundant and 1 and 2 are MUA's and
not GPG job. If GPG relies on MUA to do 1 and 2, doing just 3 is the
easiest part to implement without messing within GPG code. And really,
you DON'T want to do MIME yourself if you don't really have to.


More information about the Gnupg-devel mailing list