From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49387 Path: main.gmane.org!not-for-mail From: Andreas Fuchs Newsgroups: gmane.emacs.gnus.general Subject: Re: What method do *you* use for signing Usenet posts? Date: Mon, 20 Jan 2003 07:45:58 +0000 (UTC) Sender: owner-ding@hpc.uh.edu Message-ID: <87k7h0ntyu.fsf@eris.void.at> References: <87d6mtf3tq.fsf@pooh.honeypot.net> <87znpwrjoa.fsf@unix.home> <87el78eqce.fsf@pooh.honeypot.net> <87hec4g22z.fsf@unix.home> <87k7h0af7g.fsf@eris.void.at> <87r8b83dua.fsf@mail.paradoxical.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1043048879 23880 80.91.224.249 (20 Jan 2003 07:47:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2003 07:47:59 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18aWez-0006Cy-00 for ; Mon, 20 Jan 2003 08:47:57 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18aWeq-0005n5-00; Mon, 20 Jan 2003 01:47:48 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 20 Jan 2003 01:48:45 -0600 (CST) Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id BAA22726 for ; Mon, 20 Jan 2003 01:48:30 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18aWd5-00068N-00 for ; Mon, 20 Jan 2003 08:45:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@hpc.uh.edu Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18aWd4-00068E-00 for ; Mon, 20 Jan 2003 08:45:58 +0100 Original-Path: not-for-mail Original-Lines: 137 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never X-Url: http://asf.void.at/ X-Attribution: asf X-Face: 3*3w/y?I6|`'CYW7F~m0]U1)L\|[x"?/V6^;s3FU#q|F'AL(3C?$eslHvAmR:KjT"&LZeqM 0wMS%HM` Cancel-Lock: sha1:uUKIFjMNNXhEtH2ePjuhwT4nEr0= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49387 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49387 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable On 2003-01-19, Josh Huber wrote: > We could have some other tag, such as "pgpauto", which selected plain > PGP when there were no other attachments, but used pgp/mime if there > were. Did just that (and this message is a test of the function as well (-:). Use `M-x mml-secure-message-sign-pgpauto' to sign messages; gnus should figure the rest out by itseld. Here is the patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=mml-auto-signing.diff Content-Transfer-Encoding: quoted-printable Index: lisp/mml-sec.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/mml-sec.el,v retrieving revision 1.18 diff -c -u -r1.18 mml-sec.el =2D-- lisp/mml-sec.el 2002/10/09 23:29:53 1.18 +++ lisp/mml-sec.el 2003/01/20 07:36:58 @@ -31,6 +31,7 @@ (defvar mml-sign-alist '(("smime" mml-smime-sign-buffer mml-smime-sign-query) ("pgp" mml-pgp-sign-buffer list) + ("pgpauto" mml-pgpauto-sign-buffer list) ("pgpmime" mml-pgpmime-sign-buffer list)) "Alist of MIME signer functions.") =20 @@ -40,6 +41,7 @@ (defvar mml-encrypt-alist '(("smime" mml-smime-encrypt-buffer mml-smime-encrypt-query) ("pgp" mml-pgp-encrypt-buffer list) + ("pgpauto" mml-pgpauto-sign-buffer list) ("pgpmime" mml-pgpmime-encrypt-buffer list)) "Alist of MIME encryption functions.") =20 @@ -49,6 +51,7 @@ (defcustom mml-signencrypt-style-alist '(("smime" separate) ("pgp" separate) + ("pgpauto" separate) ("pgpmime" separate)) "Alist specifying if `signencrypt' results in two separate operations or= not. The first entry indicates the MML security type, valid entries include @@ -118,6 +121,20 @@ (or (mml2015-encrypt cont sign) (error "Encryption failed... inspect message logs for errors"))) =20 +(defun mml-pgpauto-sign-buffer (cont) + (message-goto-body) + (or (if (re-search-backward "Content-Type: *multipart/.*" nil t) ; there= must be a better way... + (mml2015-sign cont) + (mml1991-sign cont)) + (error "Encryption failed... inspect message logs for errors"))) + +(defun mml-pgpauto-encrypt-buffer (cont &optional sign) + (message-goto-body) + (or (if (re-search-backward "Content-Type: *multipart/.*" nil t) ; there= must be a better way... + (mml2015-encrypt cont sign) + (mml1991-encrypt cont sign)) + (error "Encryption failed... inspect message logs for errors"))) + (defun mml-secure-part (method &optional sign) (save-excursion (let ((tags (funcall (nth 2 (assoc method (if sign mml-sign-alist @@ -148,6 +165,11 @@ (interactive) (mml-secure-part "pgp" 'sign)) =20 +(defun mml-secure-sign-pgp () + "Add MML tags to PGP-auto sign this MML part." + (interactive) + (mml-secure-part "pgpauto" 'sign)) + (defun mml-secure-sign-pgpmime () "Add MML tags to PGP/MIME sign this MML part." (interactive) @@ -214,6 +236,11 @@ (interactive) (mml-secure-message "pgpmime" 'sign)) =20 +(defun mml-secure-message-sign-pgpauto () + "Add MML tag to encrypt/sign the entire message." + (interactive) + (mml-secure-message "pgpauto" 'sign)) + (defun mml-secure-message-encrypt-smime (&optional dontsign) "Add MML tag to encrypt and sign the entire message. If called with a prefix argument, only encrypt (do NOT sign)." @@ -231,5 +258,11 @@ If called with a prefix argument, only encrypt (do NOT sign)." (interactive "P") (mml-secure-message "pgpmime" (if dontsign 'encrypt 'signencrypt))) + +(defun mml-secure-message-encrypt-pgpmime (&optional dontsign) + "Add MML tag to encrypt and sign the entire message. +If called with a prefix argument, only encrypt (do NOT sign)." + (interactive "P") + (mml-secure-message "pgpauto" (if dontsign 'encrypt 'signencrypt))) =20 (provide 'mml-sec) --=-=-= Content-Transfer-Encoding: quoted-printable Happy hacking, =2D-=20 Andreas Fuchs, , asf@jabber.at, antifuchs --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+K6mOucDAWATX9F8RAtbrAJ9WO6fHZFepEgquYzdDLmDBDujAZwCgksXI 2B+S7PbBDeFG/UmHj5Lsnb0= =qSje -----END PGP SIGNATURE----- --==-=-=--