From: yamaoka Date: Wed, 22 Oct 2003 00:04:20 +0000 (+0000) Subject: Synch to Gnus 200310212318. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5f5db57e0bc0e1a4d2b08e1c3a567b25f3567367;p=elisp%2Fgnus.git- Synch to Gnus 200310212318. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34ccf4e..070461b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2003-10-21 Katsumi Yamaoka + * message.el (message-bounce): Don't erase except bounced header. + +2003-10-21 Teodor Zlatanov + + * spam.el (spam-reverse-ip-string): new function to reverse an IP + address in a string + (spam-check-blackholes): use spam-reverse-ip-string + +2003-10-21 Katsumi Yamaoka + * gnus-art.el (gnus-narrow-to-page): Clear as well as set the value for gnus-page-broken. diff --git a/lisp/message.el b/lisp/message.el index af4e9d9..ea26e0f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -6949,32 +6949,36 @@ contains some mail you have written which has been bounced back to you." (interactive) (let ((cur (current-buffer)) - boundary) + mime-boundary boundary) (message-pop-to-buffer (message-buffer-name "bounce")) (insert-buffer-substring cur) (undo-boundary) (message-narrow-to-head) (if (and (message-fetch-field "MIME-Version") - (setq boundary (message-fetch-field "Content-Type"))) - (if (string-match "boundary=\"\\([^\"]+\\)\"" boundary) - (setq boundary (concat (match-string 1 boundary) " *\n" - "Content-Type: message/rfc822")) - (setq boundary nil))) + (setq mime-boundary (message-fetch-field "Content-Type"))) + (if (string-match "boundary=\"\\([^\"]+\\)\"" mime-boundary) + (setq mime-boundary (concat (regexp-quote + (match-string 1 mime-boundary)) + " *\nContent-Type: message/rfc822")) + (setq mime-boundary nil))) (widen) (goto-char (point-min)) - (search-forward "\n\n" nil t) - (if (or (and boundary - (re-search-forward boundary nil t) - (forward-line 2)) - (and (re-search-forward message-unsent-separator nil t) + (re-search-forward "\n\n+" nil t) + (setq boundary (point)) + ;; We remove everything before the bounced mail. + (if (or (and mime-boundary + (re-search-forward mime-boundary nil t) (forward-line 1)) - (re-search-forward "^Return-Path:.*\n" nil t)) - ;; We remove everything before the bounced mail. - (delete-region - (point-min) - (if (re-search-forward "^[^ \n\t]+:" nil t) - (match-beginning 0) - (point))) + (re-search-forward message-unsent-separator nil t) + (progn + (search-forward "\n\n" nil 'move) + (re-search-backward "^Return-Path:.*\n" boundary t))) + (progn + (forward-line 1) + (delete-region (point-min) + (if (re-search-forward "^[^ \n\t]+:" nil t) + (match-beginning 0) + (point)))) (when (re-search-backward "^.?From .*\n" nil t) (delete-region (match-beginning 0) (match-end 0)))) (save-restriction diff --git a/lisp/spam.el b/lisp/spam.el index d50e448..9b3adb1 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -753,6 +753,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." ;;;; Blackholes. +(defun spam-reverse-ip-string (ip) + (when (stringp ip) + (mapconcat 'identity + (nreverse (split-string ip "\\.")) + "."))) + (defun spam-check-blackholes () "Check the Received headers for blackholed relays." (let ((headers (nnmail-fetch-field "received")) @@ -765,14 +771,15 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (while (re-search-forward "\\[\\([0-9]+.[0-9]+.[0-9]+.[0-9]+\\)\\]" nil t) (gnus-message 9 "Blackhole search found host IP %s." (match-string 1)) - (push (mapconcat 'identity - (nreverse (split-string (match-string 1) "\\.")) - ".") + (push (spam-reverse-ip-string (match-string 1)) ips))) (dolist (server spam-blackhole-servers) (dolist (ip ips) (unless (and spam-blackhole-good-server-regex - (string-match spam-blackhole-good-server-regex ip)) + ;; match the good-server-regex against the reversed (again) IP string + (string-match + spam-blackhole-good-server-regex + (spam-reverse-ip-string ip))) (unless matches (let ((query-string (concat ip "." server))) (if spam-use-dig