[Mew-dist 04688] Re: PGP public key fetch

Mito mit at example.com
1998年 5月 13日 (水) 21:24:41 JST


※ "白" こと Shirai at example.com さんの
   『[Mew-dist 04614] Re: PGP public key fetch』より

白> 1. C-cC-f のとき、X-Mew: のみを参照。
白> 2. C-uC-cC-f のとき、mew-x-pgp-key-list に設定したものだけ見る。

白> ように変えたパッチです。

1 の場合で、X-Mew がない場合は、From から得た User ID をキー
にして key server から fetch するようにしてみました。

[Mew-dist 04614] をあてた状態からの差分です。

--- mew-pgp.el	1998/05/13 11:39:24	1.2
+++ mew-pgp.el	1998/05/13 12:13:10
@@ -621,9 +621,11 @@
   "fetch PGP public key."
   (interactive "P")
   (if (null (processp mew-pgp-fetch-key-process))
-      (let (key key-list buf keyid xurl xurl-list xmew uri)
+      (let (key key-list buf keyid xurl xurl-list xmew uri userid)
 	(save-excursion
 	  (set-buffer (mew-buffer-message))
+	  (setq userid (mew-header-extract-addr
+			(mew-header-get-value "From:")))
 	  (cond
 	   (arg
 	    (setq key-list mew-x-pgp-key-list)
@@ -639,14 +641,7 @@
 		(setq key (car key-list)))))
 	   (t (setq xmew (mew-header-get-value mew-x-mew:)))))
 	(cond
-	 ((and xmew (not arg))
-	  (if (and (string-match "key. ID = \\(0x[0-9a-fA-F]+\\)" xmew nil)
-		   (setq keyid (substring xmew (match-beginning 1) (match-end 1)))
-		   (y-or-n-p (format "fetch key ID=%s? " keyid)))
-	      (setq uri (format mew-pgp-keyserver-url-template keyid))
-	    (if (not keyid)
-		(message "can't find PGP users key ID."))))
-	 ((and xurl-list arg)
+	 ((and arg xurl-list)
 	  (setq xurl (car xurl-list))
 	  (while (and xurl (not uri))
 	    (progn
@@ -654,16 +649,26 @@
 		  (setq uri xurl))
 	      (setq xurl-list (cdr xurl-list))
 	      (setq xurl (car xurl-list)))))
-	 (t (message "can't find PGP public key's information.")))
-	(if uri
-	    (mew-piolet mew-cs-autoconv mew-cs-autoconv
-	      (setq buf (generate-new-buffer "*Get PGP Key*"))
-	      (message "key fetching...%s." uri)
-	      (setq mew-pgp-fetch-key-process
-		    (start-process "Get PGP Key" buf mew-prog-imcat uri))
-	      (put 'mew-pgp-fetch-key-process 'buffer buf)
-	      (set-process-sentinel
-	       mew-pgp-fetch-key-process 'mew-pgp-fetch-process-done))))
+	 ((and xmew
+	       (string-match "key. ID = \\(0x[0-9a-fA-F]+\\)" xmew nil)
+	       (setq keyid (substring xmew (match-beginning 1) (match-end 1))))
+	  (if (y-or-n-p (format "fetch Key ID=%s? " keyid))
+	      (setq uri (format mew-pgp-keyserver-url-template keyid))))
+	 ((and userid
+	       (y-or-n-p (format "fetch User ID=%s? " userid)))
+	  (setq uri (format mew-pgp-keyserver-url-template userid))
+	  ))
+	(if (not uri)
+	    (message "can't find PGP public key's information.")
+	  (mew-piolet
+           mew-cs-autoconv mew-cs-autoconv
+           (setq buf (generate-new-buffer "*Get PGP Key*"))
+           (message "key fetching...%s." uri)
+           (setq mew-pgp-fetch-key-process
+                 (start-process "Get PGP Key" buf mew-prog-imcat uri))
+           (put 'mew-pgp-fetch-key-process 'buffer buf)
+           (set-process-sentinel
+            mew-pgp-fetch-key-process 'mew-pgp-fetch-process-done))))
     (if (y-or-n-p "Fetching process is running. Continue fetching process? ")
 	()
       (mew-pgp-fetch-process-kill))))
-- 
5/13 21:23頃
NECソフトウェア新潟 水戸
mailto:mit at example.com \n



Mew-dist メーリングリストの案内