From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24124 Path: main.gmane.org!not-for-mail From: Florian Weimer Newsgroups: gmane.emacs.gnus.general Subject: Re: MIME-PGP Date: 10 Jul 1999 20:14:42 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035161745 7023 80.91.224.250 (21 Oct 2002 00:55:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:55:45 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA18063 for ; Sat, 10 Jul 1999 14:09:27 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAB28373; Sat, 10 Jul 1999 13:09:23 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 10 Jul 1999 13:10:15 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA29113 for ; Sat, 10 Jul 1999 13:10:03 -0500 (CDT) Original-Received: from delos.stuttgart.netsurf.de (delos.stuttgart.netsurf.de [194.163.56.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA18051 for ; Sat, 10 Jul 1999 14:08:56 -0400 (EDT) Original-Received: by delos.stuttgart.netsurf.de (Smail3.2.0.103/delos.LF.net) via LF.net GmbH Internet Services via remoteip 194.163.56.20 via remotehost cygnus.stuttgart.netsurf.de with esmtp for mailhost.sclp.com id m1131YU-000RzsC; Sat, 10 Jul 1999 20:08:54 +0200 (MET DST) Original-Received: from deneb.cygnus.stuttgart.netsurf.de (deneb.cygnus.stuttgart.netsurf.de [192.168.0.1]) by cygnus.stuttgart.netsurf.de (8.8.7/8.8.7) with ESMTP id UAA01439 for ; Sat, 10 Jul 1999 20:09:59 +0200 Original-Received: (from fw@localhost) by deneb.cygnus.stuttgart.netsurf.de (8.9.3/8.9.3) id UAA01300; Sat, 10 Jul 1999 20:14:42 +0200 Original-To: ding@gnus.org In-Reply-To: Lars Magne Ingebrigtsen's message of "09 Jul 1999 18:51:27 +0200" Original-Lines: 74 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) XEmacs/21.1 (20 Minutes to Nikko) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:24124 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:24124 Lars Magne Ingebrigtsen writes: > > If verification is done during the display phase, the format of the MIME > > handles has to be modified to contain information on how to obtain the > > raw message data. I don't know how feasible this is. > > It's no problem -- I'll just add a `mm-handle-raw-content' accessor, > and store the raw contents where they can be got at. Great. For the encoding case, I'd like to suggest the following hook (diff against pgnus 0.95): --- /opt/pgnus/lisp/mml.el Sat Jul 10 11:15:29 1999 +++ /tmp/mml.el Sat Jul 10 20:08:09 1999 @@ -31,6 +31,19 @@ (eval-and-compile (autoload 'message-make-message-id "message")) +(defvar mml-generate-multipart-alist + '(("signed" . rfc2015-generate-signed-multipart) + ("encrypted" . rfc2015-generate-encrypted-multipart)) + "*Alist of multipart generation functions. + +Each entry has the form (NAME . FUNCTION), where +NAME: is a string containing the name of the part (without the +leading \"/multipart/\"), +FUNCTION: is a Lisp function which is called to generate the part. + +The Lisp function has to supply the appropriate MIME headers and the +contents of this part.") + (defvar mml-syntax-table (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) (modify-syntax-entry ?\\ "/" table) @@ -271,16 +284,20 @@ (insert (or (cdr (assq 'contents cont)))) (insert "\n")) ((eq (car cont) 'multipart) - (let ((mml-boundary (mml-compute-boundary cont))) - (insert (format "Content-Type: multipart/%s; boundary=\"%s\"\n" - (or (cdr (assq 'type cont)) "mixed") - mml-boundary)) - (insert "\n") - (setq cont (cddr cont)) - (while cont - (insert "\n--" mml-boundary "\n") - (mml-generate-mime-1 (pop cont))) - (insert "\n--" mml-boundary "--\n"))) + (let* ((type (or (cdr (assq 'type cont)) "mixed")) + (handler (assoc type mml-generate-multipart-alist))) + (if handler + (funcall (cdr handler) cont) + ;; No specific handler. Use default one. + (let ((mml-boundary (mml-compute-boundary cont))) + (insert (format "Content-Type: multipart/%s; boundary=\"%s\"\n" + type mml-boundary)) + (insert "\n") + (setq cont (cddr cont)) + (while cont + (insert "\n--" mml-boundary "\n") + (mml-generate-mime-1 (pop cont))) + (insert "\n--" mml-boundary "--\n"))))) (t (error "Invalid element: %S" cont)))) > I would imagine that we would add some encoding handlers for MIME > encryption that would force mml to encode using qp, no matter what. > There's no such thing in there yet, but I don't think it would be > difficult to add stuff like that. I've got a solution which changes `mm-content-transfer-encoding', `mm-body-encoding', and of course `quoted-printable-encode-region' so that these functions use `safe' encodings if a special variable is bound to a non-nil value. Do you thing that's the way to go?