From: Katsumi Yamaoka Date: Wed, 3 Dec 2008 23:49:00 +0000 (+0000) Subject: (message-idna-to-ascii-rhs-1): Fix previous commit. X-Git-Tag: emacs-pretest-23.0.90~1293 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/1bd6cd6c649d0f6d43ed4986c9d2e49757be4d9e (message-idna-to-ascii-rhs-1): Fix previous commit. (message-idna-to-ascii-rhs): Add a comment. Suggested by RMS. --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index d25603f039..019fb626ee 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -5635,14 +5635,13 @@ subscribed address (and not the additional To and Cc header contents)." (dolist (rhs (mm-delete-duplicates (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) "")) - (mapcar (lambda (domain) - (if domain - (downcase domain) - "")) + (mapcar 'downcase (mapcar 'cadr (mail-extract-address-components field t)))))) - (setq ace (if (string-match "\\`[[:ascii:]]+\\'" rhs) + ;; Note that `rhs' will be "" if the address does not have + ;; the domain part, i.e., if it is a local user's address. + (setq ace (if (string-match "\\`[[:ascii:]]*\\'" rhs) rhs (downcase (idna-to-ascii rhs)))) (when (and (not (equal rhs ace)) @@ -5664,6 +5663,12 @@ See `message-idna-encode'." (when message-use-idna (save-excursion (save-restriction + ;; `message-narrow-to-head' that recognizes only the first empty + ;; line as the message header separator used to be used here. + ;; However, since there is the "--text follows this line--" line + ;; normally, it failed in narrowing to the headers and potentially + ;; caused the IDNA encoding on lines that look like headers in + ;; the message body. (message-narrow-to-headers-or-head) (message-idna-to-ascii-rhs-1 "From") (message-idna-to-ascii-rhs-1 "To")