]> code.delx.au - gnu-emacs/commitdiff
Merge from gnus--devo--0
authorMiles Bader <miles@gnu.org>
Sun, 1 Jun 2008 02:34:55 +0000 (02:34 +0000)
committerMiles Bader <miles@gnu.org>
Sun, 1 Jun 2008 02:34:55 +0000 (02:34 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1192

lisp/gnus/ChangeLog
lisp/gnus/message.el
lisp/gnus/nnmairix.el
lisp/gnus/rfc2231.el

index 391ff5b6b340a30010b3ef7dda986ee6f6be96c0..67da384654015c7fce0205e66a239052ceccb5d9 100644 (file)
@@ -1,3 +1,20 @@
+2008-05-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * rfc2231.el (rfc2231-decode-encoded-string): Don't decode things that
+       are not 2-digit hexadecimal characters that follow `%'s.
+
+2008-05-29  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * message.el (message-bogus-recipient-p): Fix type in doc string.
+       Reported by Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk>.
+       (message-bogus-addresses): Rename from message-bogus-address-regexp.
+       Improve custom options.
+       (message-bogus-recipient-p): Adjust accordingly.
+
+2008-05-26  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * nnmairix.el: Require edmacro when compiling with XEmacs.
+
 2008-05-24  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-sum.el (gnus-summary-initial-limit): Use unless instead of if.
index 82dd24c56b60659fa22f8588fb40c6f8c910ac37..b790ac433c9b800eb09e23c0bcc5ce0ed0a881f6 100644 (file)
@@ -4060,19 +4060,32 @@ not have PROP."
        (setq start next)))
     (nreverse regions)))
 
-(defcustom message-bogus-address-regexp nil ;; "noreply\\|nospam\\|invalid"
-  "Regexp of potentially bogus mail addresses."
+(defcustom message-bogus-addresses
+  ;; '("noreply" "nospam" "invalid")
+  '("noreply" "nospam" "invalid" "@@" "[^[:ascii:]].*@" "[ \t]")
+  "List of regexps of potentially bogus mail addresses.
+See `message-check-recipients' how to setup checking.
+
+This list should make it possible to catch typos or warn about
+spam-trap addresses.  It doesn't aim to verify strict RFC
+conformance."
   :version "23.1" ;; No Gnus
   :group 'message-headers
-  :type '(choice (const :tag "None" nil)
-                (repeat :value-to-internal (lambda (widget value)
-                                             (custom-split-regexp-maybe value))
-                        :match (lambda (widget value)
-                                 (or (stringp value)
-                                     (widget-editable-list-match widget value)))
-                        regexp)
-                (const "noreply\\|nospam\\|invalid")
-                regexp))
+  :type '(choice
+         (const :tag "None" nil)
+         (list
+          (set :inline t
+               (const "noreply")
+               (const "nospam")
+               (const "invalid")
+               (const :tag "duplicate @" "@@")
+               (const :tag "non-ascii local part" "[^[:ascii:]].*@")
+               ;; Already caught by `message-valid-fqdn-regexp'
+               ;; (const :tag "`_' in domain part" "@.*_")
+               (const :tag "whitespace" "[ \t]"))
+          (repeat :inline t
+                  :tag "Other"
+                  (regexp)))))
 
 (defun message-fix-before-sending ()
   "Do various things to make the message nice before sending it."
@@ -4167,9 +4180,9 @@ not have PROP."
 RECIPIENTS is a mail header.  Return a list of potentially bogus
 addresses.  If none is found, return nil.
 
-An addresses might be bogus if the domain part is not fully
-qualified, see `message-valid-fqdn-regexp', or if it matches
-`message-bogus-address-regexp'."
+An address might be bogus if the domain part is not fully
+qualified, see `message-valid-fqdn-regexp', or if there's a
+matching entry in `message-bogus-addresses'."
   ;; FIXME: How about "foo@subdomain", when the MTA adds ".domain.tld"?
   (let (found)
     (mapc (lambda (address)
@@ -4181,9 +4194,15 @@ qualified, see `message-valid-fqdn-regexp', or if it matches
                      (string-match
                       (concat ".@.*\\("
                               message-valid-fqdn-regexp "\\)\\'") address)))
-                   (and (stringp message-bogus-address-regexp)
-                        (string-match message-bogus-address-regexp address)))
-             (push address found)))
+                   (and message-bogus-addresses
+                        (let ((re
+                               (if (listp message-bogus-addresses)
+                                   (mapconcat 'identity
+                                              message-bogus-addresses
+                                              "\\|")
+                                 message-bogus-addresses)))
+                          (string-match re address))))
+                        (push address found)))
          ;;
          (mail-extract-address-components recipients t))
     found))
index 6ed58682e263d19473a9366270c0aa25cb7c5346..33d164267445060120ac3da12a45a1cef35dacf2 100644 (file)
 
 ;;; === Keymaps
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    ;; The `kbd' macro requires that the `read-kbd-macro' macro is available.
+    (require 'edmacro)))
+
 ;; Group mode
 (defun nnmairix-group-mode-hook ()
   "Nnmairix group mode keymap."
index 1dd2e43b0a3ef1dcbfea358c39c53994acaeb220..523f6640dc484e5460e51c505356c01f5f45dc29 100644 (file)
@@ -214,11 +214,11 @@ These look like:
     (mm-with-unibyte-buffer
       (insert value)
       (goto-char (point-min))
-      (while (search-forward "%" nil t)
+      (while (re-search-forward "%\\([0-9A-Fa-f][0-9A-Fa-f]\\)" nil t)
        (insert
         (prog1
-            (string-to-number (buffer-substring (point) (+ (point) 2)) 16)
-          (delete-region (1- (point)) (+ (point) 2)))))
+            (string-to-number (match-string 1) 16)
+          (delete-region (match-beginning 0) (match-end 0)))))
       ;; Decode using the charset, if any.
       (if (memq coding-system '(nil ascii))
          (buffer-string)