I've made some patches to bbdb-pgp.el to allow it to handle newsgroups
with a finer level of detail as well as permit the user to remove the
constant questioning of whether or not to sign a document.  I also
changed it to use mml-secure-message-* instead of mml-secure-*.

I documented the new variable but not the code.  If the maintainer is
still around, they're welcome to add my patch and whatever
documentation they like so the other folks who use this can take
advantage of my changes, such as they are.

Jack.
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
115a116,120
> (defvar bbdb/pgp-ask t
>   "*Flag to determine whether or not to ask to sign or encrypt.
> nil         means don't ask.
> t           means ask.")
> 
135,136c140,144
<       (let* ((to-field (mail-fetch-field "To" nil t))
< 	     (address (mail-extract-address-components (or to-field ""))))
---
> ;      (let* ((to-field (mail-fetch-field "To" nil t))
>       (let* ((to-field (message-fetch-field "to"))
> 	     (ngpair (cons (message-fetch-field "newsgroups") '(nil)))
> 	     (address (mail-extract-address-components (or to-field "")))
> 	     (target (or ngpair address)))
138,140c146,147
< 	;if
< 	(if (not (equal address '(nil nil)))
< 	    (let ((pgp-p (bbdb/pgp-get-pgp (car address) (car (cdr address)))))
---
> 	(if (not (equal target '(nil nil)))
> 	    (let ((pgp-p (bbdb/pgp-get-pgp (car target) (car (cdr target)))))
142c149
< 
---
> 	       
144,145c151,153
< 		(and (y-or-n-p "Encrypt message (body) ? ")
< 		     (mml-secure-encrypt-pgp)))
---
> 		(if (or (not bbdb/pgp-ask)
> 			(y-or-n-p "Encrypt message (body) ? "))
> 		    (mml-secure-message-encrypt-pgp)))
147,148c155,157
< 		(and (y-or-n-p "Encrypt message ? ")
< 		     (mml-secure-encrypt-pgpmime)))
---
> 		(if (or (not bbdb/pgp-ask)
> 			(y-or-n-p "Encrypt message ? "))
> 		    (mml-secure-message-encrypt-pgpmime)))
151,152c160,162
< 		(and (y-or-n-p "Sign message (body) ? ")
< 		     (mml-secure-sign-pgp)))
---
> 		(if (or (not bbdb/pgp-ask)
> 			(y-or-n-p "Sign message (body) ? "))
> 		    (mml-secure-message-sign-pgp)))
154,180c164,192
< 		(and (y-or-n-p "Sign message ? ")
< 		     (mml-secure-sign-pgpmime)))
< 
< 	       (t
< 		(if (or (not (boundp 'bbdb-dont-default))
< 			     (not bbdb-dont-default))
< 
< 		    (cond
< 		     ((eq bbdb/pgp-default-action 'sencrypt)
< 		      (and (y-or-n-p "Encrypt message (body) ? ")
< 			   (mml-secure-encrypt-pgp)))
< 		     ((eq bbdb/pgp-default-action 'encrypt)
< 		      (and (y-or-n-p "Encrypt message ? ")
< 			   (mml-secure-encrypt-pgpmime)))
< 		     ((eq bbdb/pgp-default-action 'ssign)
< 		      (and (y-or-n-p "Sign message (body) ? ")
< 			   (mml-secure-sign-pgp)))
< 
< 		     ((eq bbdb/pgp-default-action 'sign)
< 		      (and (or (not (or (not (boundp 'bbdb-force-default))
< 				    (not bbdb-force-default)))
< 			       (y-or-n-p "Sign message ? "))
< 
< 			   (if (message-news-p)
< 			       (mml-secure-sign-pgp)
< 			     (mml-secure-sign-pgpmime))
< 			   ))
---
> 		(if (or (not bbdb/pgp-ask)
> 			(y-or-n-p "Sign message ? "))
> 		    (mml-secure-message-sign-pgpmime)))
> 
> 	       ((string= "none" pgp-p)
> 		nil)
> 
> 	       (t  ;; anything else, or no field at all
> 
> 		(cond
> 		 ((eq bbdb/pgp-default-action 'sencrypt)
> 		  (if (or (not bbdb/pgp-ask)
> 			  (y-or-n-p "Encrypt message (body) ? "))
> 		      (mml-secure-message-encrypt-pgp)))
> 		 ((eq bbdb/pgp-default-action 'encrypt)
> 		  (if (or (not bbdb/pgp-ask)
> 			  (y-or-n-p "Encrypt message ? "))
> 		      (mml-secure-message-encrypt-pgpmime)))
> 		 ((eq bbdb/pgp-default-action 'ssign)
> 		  (if (or (not bbdb/pgp-ask)
> 			  (y-or-n-p "Sign message (body) ? "))
> 		      (mml-secure-message-sign-pgp)))
> 	       
> 		 ((eq bbdb/pgp-default-action 'sign)
> 		  (if (or (not bbdb/pgp-ask)
> 			  (y-or-n-p "Sign message ? "))
> 		      (if (message-news-p)
> 			  (mml-secure-message-sign-pgp)
> 			(mml-secure-message-sign-pgpmime))))
182,185c194,196
< 		  nil))) )))
< 		)
< 	
< 	))))
---
> 		  nil)
> 		 ))))
> 	  )))))

Attachment: msg02824/pgp00000.pgp
Description: PGP signature

Reply via email to