Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Fuchs <asf@void.at>
Subject: Re: What method do *you* use for signing Usenet posts?
Date: Mon, 20 Jan 2003 07:45:58 +0000 (UTC)	[thread overview]
Message-ID: <87k7h0ntyu.fsf@eris.void.at> (raw)
In-Reply-To: <87r8b83dua.fsf@mail.paradoxical.net>


[-- Attachment #1.1: Type: text/plain, Size: 411 bytes --]

On 2003-01-19, Josh Huber <huber@alum.wpi.edu> 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:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: mml-auto-signing.diff --]
[-- Type: text/x-patch, Size: 3379 bytes --]

Index: lisp/mml-sec.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mml-sec.el,v
retrieving revision 1.18
diff -c -u -r1.18 mml-sec.el
--- 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.")
 
@@ -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.")
 
@@ -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")))
 
+(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))
 
+(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))
 
+(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)))
 
 (provide 'mml-sec)

[-- Attachment #1.3: Type: text/plain, Size: 79 bytes --]


Happy hacking,
-- 
Andreas Fuchs, <asf@acm.org>, asf@jabber.at, antifuchs

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

  reply	other threads:[~2003-01-20  7:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-19 17:26 Kirk Strauser
2003-01-19 18:12 ` Josh Huber
2003-01-19 18:34   ` Kirk Strauser
2003-01-19 20:03 ` Vasily Korytov
2003-01-19 21:19   ` Xavier MAILLARD
2003-01-19 22:18   ` Kirk Strauser
2003-01-19 23:02     ` Simon Josefsson
2003-01-19 23:19     ` Vasily Korytov
2003-01-19 23:30       ` Andreas Fuchs
2003-01-19 23:43         ` Josh Huber
2003-01-20  7:45           ` Andreas Fuchs [this message]
2003-01-21  6:07             ` Lars Magne Ingebrigtsen
2003-01-21  8:46               ` Xavier MAILLARD
2003-01-21 10:03                 ` Lars Magne Ingebrigtsen
2003-01-21  9:31               ` Andreas Fuchs
2003-01-21  9:48                 ` Andreas Fuchs
2003-01-21 10:05                 ` Lars Magne Ingebrigtsen
2003-01-19 23:45         ` Vasily Korytov
2003-01-20  0:29           ` Andreas Fuchs
2003-01-20  0:49             ` Vasily Korytov
2003-01-20  1:17               ` Vasily Korytov
2003-01-20 10:25         ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k7h0ntyu.fsf@eris.void.at \
    --to=asf@void.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).