]> git.eshelyaron.com Git - emacs.git/commitdiff
(mh-mml-to-mime): GPG requires e-mail addresses, not
authorJeffrey C Honig <jch@bsdi.com>
Sun, 19 Aug 2007 21:17:59 +0000 (21:17 +0000)
committerJeffrey C Honig <jch@bsdi.com>
Sun, 19 Aug 2007 21:17:59 +0000 (21:17 +0000)
aliases.  So resolve aliases before passing addresses to GPG/PGP.
Closes SF #649226.

lisp/mh-e/ChangeLog
lisp/mh-e/mh-mime.el

index 72f39b2c3611145dfae2d505cfc003553671c00f..c865fea9f9aa23f20a0594c431d47838d866a58a 100644 (file)
@@ -1,5 +1,9 @@
 2007-08-19  Jeffrey C Honig  <jch@honig.net>
 
+       * mh-mime.el (mh-mml-to-mime): GPG requires e-mail addresses, not
+       aliases.  So resolve aliases before passing addresses to GPG/PGP.
+       Closes SF #649226.
+
        * mh-e.el (mh-invisible-header-fields-internal): Update with all
        the entries from
        http://people.dsv.su.se/~jpalme/ietf/mail-headers, plus some of my
index 4b10ad1859233b5a46fdd152719af67b7f08182e..eefaa0ed8ac7c22063d5213c029af841bd44a682 100644 (file)
@@ -1621,8 +1621,22 @@ encoding if you wish by running this command.
 This action can be undone by running \\[undo]."
   (interactive)
   (require 'message)
-  (when mh-pgp-support-flag ;; This is only needed for PGP
-    (message-options-set-recipient))
+  (when mh-pgp-support-flag
+    ;; PGP requires actual e-mail addresses, not aliases.
+    ;; Parse the recipients and sender from the message
+    (message-options-set-recipient)
+    ;; Do an alias lookup on sender
+    (message-options-set 'message-sender
+                     (mail-strip-quoted-names
+                      (mh-alias-expand
+                       (message-options-get 'message-sender))))
+    ;; Do an alias lookup on recipients
+    (message-options-set 'message-recipients
+                         (mapconcat
+                          '(lambda (ali)
+                             (mail-strip-quoted-names (mh-alias-expand ali)))
+                          (split-string (message-options-get 'message-recipients) "[, ]+")
+                          ", ")))
   (let ((saved-text (buffer-string))
         (buffer (current-buffer))
         (modified-flag (buffer-modified-p)))