Subject: Re: Content-Type: application/pgp - how to decode?

From: [email-masked] (Dominic Lai)
Date: 25 Mar 1996 05:47:23 GMT

Roland Rosenfeld ([email-masked]) wrote:
: I got some mail with "Content-Type: application/pgp" in the header.
: Pine does not want to show this directly but Pine thinks that this is
: a MIME attachment.
: So I added the Line
: application/pgp; /usr/local/bin/pgp
: to mailcap but this does not seem to work :-(
: What am I doing wrong?

Yes, this attachment type header is generated by ELM ME version.  I
had been looking at the source code for 2 days and finally get
a quite rude solution.  Disclaimer: I do not guarantee that it works
100% correctly.  Use at your own risk...  :^)

1.  at the file mailview.c, in pine directory,
    locate the portion "user_viewer = 0;" in the function
    void describe_mime(body, prefix, ...)

2.  add the following code after the "use_viewer = 0" :

/* modified by [email-masked],
   to treat application/pgp as text/plain */
        /* this is for elm-me, which produces application/pgp */
        if (body->type == TYPEAPPLICATION) {
                if (!strucmp(body->subtype, "pgp")) {
                        body->type = TYPETEXT;
                        strcpy(body->subtype, "plain");
                }
        /* this is for elm-pgp, which produces application/X-pgp-message  */
                else if (!strucmp(body->subtype, "X-pgp-message")) {
                        body->type = TYPETEXT;
                        strcpy(body->subtype, "plain");
                }
        }

3.  recompile the pine source tree

My point on this hacking is to force application/pgp to be readed
as text/plain, so as to allow pine to proceed running the display
filter.

By the way, thanks for your display filter scripts on PGP.  :^)

Dominic

--
                                            .
Lai Chi-Yuen Dominic                        .  [email-masked] 
Technician, Department of Computer Science  ......................
The Hong Kong University of                 .  Office : Room 4202
Science & Technology                        .  Phone  : 2358-7005
Home Page : http://www.cs.ust.hk/~dominic
PGP Key is available at the URL:
http://swissnet.ai.mit.edu:11371/pks/lookup?op=index&search=[email-masked]

---

From: [email-masked] (Janne Snabb)
Date: 28 Mar 96 18:12:43 GMT

[email-masked] (Dominic Lai) writes:

[...]

>as text/plain, so as to allow pine to proceed running the display

I think hacking pine source code and recompiling it is a little
ugly solution and not necessarily applicaple in large sites.

I have solved the problem with receiving mail written with Elm PGP
interfaces by adding the following three lines at the beginning of
my .procmailrc:

:0 Hfhw
* ^Content-Type:.*application/(x-pgp-message|pgp)
| formail -i "Content-Type: text/plain"

This changes Content-Type header to indicate just text/plain type
message so that pine is able to display it. Of course you have to
have procmail (with formail) installed.

--
Janne Snabb
[email-masked]

---

From: [email-masked] (Jason Baker)
Date: 28 Mar 96 17:18:44 PST

[...]

>have procmail (with formail) installed.

The only problem with this approach is that the user gets hit with
the attachment menu, and has to hit a few more keystrokes to get it
to display.  I figure that's no big deal, but others have expressed
differing opinions. :)

I'd say that if you've got the access, then recompiling the pine
source is the optimum way to do it, just remember that you'll increase
your workload come next patch/version.

>Janne Snabb

Jason

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 [email-masked]                    | To err is human; to really
 Systems Administrator, Information Systems    | bugger things up requires
 BC Family Maintenance Enforcement Program     | the root password.

 print unpack("u","92G5S\=\"!A;F]T:&5R(\'!E<FP\@:&%C:V5R\"\@\`\`");