Changes committed gnus/lisp (message.el)

"Katsumi Yamaoka" <[email protected]> Thu, 04 Dec 2008 00:49:19 +0100
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: message.el

(message-idna-to-ascii-rhs-1): Fix previous commit.
(message-idna-to-ascii-rhs): Add a comment.  Suggested by RMS.


Index: message.el
diff -u gnus/lisp/message.el:7.275 gnus/lisp/message.el:7.276
--- message.el:7.275	Wed Dec  3 04:01:02 2008
+++ message.el	Thu Dec  4 00:49:19 2008
@@ -5631,14 +5631,13 @@
       (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))
@@ -5660,6 +5659,12 @@
   (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")