File: 060_encrypt.patch

package info (click to toggle)
mew-beta 7.0.50~6.6%2B0.20140902-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 4,640 kB
  • ctags: 4,784
  • sloc: lisp: 36,518; ansic: 3,597; haskell: 577; sh: 440; makefile: 414; ruby: 310; perl: 58
file content (47 lines) | stat: -rw-r--r-- 1,864 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Subject: Fix incorrect keys in encryption
Origin: upstream, https://github.com/kazu-yamamoto/Mew/commit/5fa1fbd130f90b8afbeef66e256eead031f17e27
Bug: https://github.com/kazu-yamamoto/Mew/issues/77

    Match exactly on an email address to specify a user ID to GnuPG

diff --git a/mew-pgp.el b/mew-pgp.el
index 6336773..dc2f5b0 100644
--- a/mew-pgp.el
+++ b/mew-pgp.el
@@ -417,6 +417,10 @@ Set 1 if 5. Set 2 if 6. Set 3 if GNUPG.")
     (if (and mew-encrypt-to-myself
 	     (not (member mew-inherit-encode-pgp-signer decrypters)))
 	(setq decrypters (cons mew-inherit-encode-pgp-signer decrypters)))
+    (setq decrypters
+	  (mapcar (lambda (x)
+		    (if (string-match "^[^<].*@" x) (concat "<" x ">") x))
+		  decrypters))
     (if (not roption)
 	(setq args (append (list ooption file3 file1) eoptions decrypters))
       (mapc
@@ -852,6 +856,10 @@ Set 1 if 5. Set 2 if 6. Set 3 if GNUPG.")
     (if (and mew-encrypt-to-myself
 	     (not (member mew-inherit-encode-pgp-signer decrypters)))
 	(setq decrypters (cons mew-inherit-encode-pgp-signer decrypters)))
+    (setq decrypters
+	  (mapcar (lambda (x)
+		    (if (string-match "^[^<].*@" x) (concat "<" x ">") x))
+		  decrypters))
     (setq file2 (mew-make-temp-name))
     (setq args (list loption mew-inherit-encode-pgp-signer ooption file2 file1))
     (if (not roption)
diff --git a/mew-smime.el b/mew-smime.el
index 61b766d..5169e5c 100644
--- a/mew-smime.el
+++ b/mew-smime.el
@@ -457,6 +457,10 @@
   (if (and mew-encrypt-to-myself
 	   (not (member mew-inherit-encode-smime-signer decrypters)))
       (setq decrypters (cons mew-inherit-encode-smime-signer decrypters)))
+  (setq decrypters
+	(mapcar (lambda (x)
+		  (if (string-match "^[^<].*@" x) (concat "<" x ">") x))
+		decrypters))
   (let (decs)
     (dolist (decrypter decrypters)
       (setq decs (cons decrypter (cons roption decs))))