Display the encoded version of the bogus address if they differ.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 22 Jan 2011 19:17:45 +0000 (20:17 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 22 Jan 2011 19:17:45 +0000 (20:17 +0100)
lisp/ChangeLog
lisp/message.el

index f31db7b..db5792b 100644 (file)
@@ -1,5 +1,8 @@
 2011-01-22  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * message.el (message-check-recipients): Display the encoded version of
+       the bogus address if they differ.
+
        * gnus-draft.el (gnus-group-send-queue): Really refresh the queue group
        after sending.
 
index f035cf4..d93c05c 100644 (file)
@@ -4337,7 +4337,17 @@ This function could be useful in `message-setup-hook'."
            (and bog
                 (not (y-or-n-p
                       (format
-                       "Address `%s' might be bogus.  Continue? " bog)))
+                       "Address `%s'%s might be bogus.  Continue? "
+                       bog
+                       ;; If the encoded version of the email address
+                       ;; is different from the unencoded version,
+                       ;; then we likely have invisible characters or
+                       ;; the like.  Display the encoded version,
+                       ;; too.
+                       (let ((encoded (rfc2047-encode-string bog)))
+                         (if (string= encoded bog)
+                             ""
+                           (format " (%s)" encoded))))))
                 (error "Bogus address"))))))))
 
 (custom-add-option 'message-setup-hook 'message-check-recipients)