2010-10-26 Daiki Ueno <ueno@unixuser.org>
* epa-mail.el (epa-mail-encrypt): Handle local-part only
- recipients (Bug#7280).
+ recipients; expand mail aliases (Bug#7280).
2010-10-25 Glenn Morris <rgm@gnu.org>
(save-excursion
(let ((verbose current-prefix-arg)
(context (epg-make-context epa-protocol))
- recipients recipient-key)
+ recipients-string recipients recipient-key)
(goto-char (point-min))
(save-restriction
(narrow-to-region (point)
(if (search-forward mail-header-separator nil 0)
(match-beginning 0)
(point)))
+ (setq recipients-string
+ (mapconcat #'identity
+ (nconc (mail-fetch-field "to" nil nil t)
+ (mail-fetch-field "cc" nil nil t)
+ (mail-fetch-field "bcc" nil nil t))
+ ","))
(setq recipients
(mail-strip-quoted-names
- (mapconcat #'identity
- (nconc (mail-fetch-field "to" nil nil t)
- (mail-fetch-field "cc" nil nil t)
- (mail-fetch-field "bcc" nil nil t))
- ","))))
+ (with-temp-buffer
+ (insert "to: " recipients-string "\n")
+ (expand-mail-aliases (point-min) (point-max))
+ (car (mail-fetch-field "to" nil nil t))))))
(if recipients
(setq recipients (delete ""
- (split-string recipients "[ \t\n]+"))))
+ (split-string recipients
+ "[ \t\n]*,[ \t\n]*"))))
(goto-char (point-min))
(if (search-forward mail-header-separator nil t)
(forward-line))