aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mh-e
diff options
context:
space:
mode:
authorJeffrey C Honig <[email protected]>2007-08-19 21:17:59 +0000
committerJeffrey C Honig <[email protected]>2007-08-19 21:17:59 +0000
commit2001ba38f6d4fe433c69dcf512bbc3433f7f300b (patch)
tree4176594a2dbf5ff45314da92068a4151d6ecc94d /lisp/mh-e
parent243256f81319ffd8dc3fb61e969efde40c2e9bd1 (diff)
(mh-mml-to-mime): GPG requires e-mail addresses, not
aliases. So resolve aliases before passing addresses to GPG/PGP. Closes SF #649226.
Diffstat (limited to 'lisp/mh-e')
-rw-r--r--lisp/mh-e/ChangeLog4
-rw-r--r--lisp/mh-e/mh-mime.el18
2 files changed, 20 insertions, 2 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 72f39b2c36..c865fea9f9 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,5 +1,9 @@
2007-08-19 Jeffrey C Honig <[email protected]>
+ * 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
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 4b10ad1859..eefaa0ed8a 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -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)))