From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8661 Path: main.gmane.org!not-for-mail From: David Moore Newsgroups: gmane.emacs.gnus.general Subject: patch for broken 0.55 nnmail-process-unix-mail-format Date: 07 Nov 1996 18:03:42 -0800 Sender: dmoore@sdnp5.ucsd.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148794 13533 80.91.224.250 (20 Oct 2002 21:19:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:19:54 +0000 (UTC) Return-Path: Original-Received: (qmail 1407 invoked from smtpd); 8 Nov 1996 02:28:46 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 8 Nov 1996 02:28:45 -0000 Original-Received: from UCSD.EDU (mailbox1.ucsd.edu [132.239.1.53]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Fri, 8 Nov 1996 03:04:43 +0100 Original-Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by UCSD.EDU (8.8.2/8.6.9) with SMTP id SAA15095 for ; Thu, 7 Nov 1996 18:04:41 -0800 (PST) Original-Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4) id SAA15068; Thu, 7 Nov 1996 18:03:43 -0800 Original-To: "(ding) Gnus Mailing List" In-Reply-To: Steven L Baur's message of 07 Nov 1996 11:44:06 -0800 Original-Lines: 116 X-Mailer: Red Gnus v0.55/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:8661 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8661 > nnmail-process-unix-mail-format explicitly sets case-fold-search to > nil. This causes the test for a previous message to lose when it does > not match Message-ID: exactly. Since all headers are case > insensitive, either the tests: > There are a number of mailers that will attach a message id as > Message-Id: so this definitely needs fixing. This is a new bug in rgnus 0.55, introduced with the new 'From ' line algorithm. Half of the messages I received today now has a bogus 'Message-ID' line overriding a valid 'Message-Id' one. :) This patch should help. Although probably the routine should be split up to handle this more cleanly. *** nnmail.el.orig Thu Nov 7 17:53:40 1996 --- nnmail.el Thu Nov 7 17:59:39 1996 *************** *** 675,703 **** (not (eobp))) (forward-line 1) (point)))) ! ;; Find the Message-ID header. ! (goto-char (point-min)) ! (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t) ! (setq message-id (match-string 1)) ! (save-excursion ! (when (re-search-forward "^Message-ID:" nil t) ! (beginning-of-line) ! (insert "Original-"))) ! ;; There is no Message-ID here, so we create one. ! (forward-line 1) ! (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) ! ;; Look for a Content-Length header. ! (goto-char (point-min)) ! (if (not (re-search-forward ! "^Content-Length:[ \t]*\\([0-9]+\\)" nil t)) ! (setq content-length nil) ! (setq content-length (string-to-int (match-string 1))) ! ;; We destroy the header, since none of the backends ever ! ;; use it, and we do not want to confuse other mailers by ! ;; having a (possibly) faulty header. ! (beginning-of-line) ! (insert "X-")) ! (run-hooks 'nnmail-prepare-incoming-header-hook) ;; Find the end of this article. (goto-char (point-max)) (widen) --- 675,707 ---- (not (eobp))) (forward-line 1) (point)))) ! ;; Search for message-id, content-length and run prepare hooks ! ;; with case-fold-search t. As in rgnus 0.54. ! (let ((case-fold-search t)) ! ;; Find the Message-ID header. ! (goto-char (point-min)) ! (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t) ! (setq message-id (match-string 1)) ! (save-excursion ! (when (re-search-forward "^Message-ID:" nil t) ! (beginning-of-line) ! (insert "Original-"))) ! ;; There is no Message-ID here, so we create one. ! (forward-line 1) ! (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) ! ;; Look for a Content-Length header. ! (goto-char (point-min)) ! (if (not (re-search-forward ! "^Content-Length:[ \t]*\\([0-9]+\\)" nil t)) ! (setq content-length nil) ! (setq content-length (string-to-int (match-string 1))) ! ;; We destroy the header, since none of the backends ever ! ;; use it, and we do not want to confuse other mailers by ! ;; having a (possibly) faulty header. ! (beginning-of-line) ! (insert "X-")) ! (run-hooks 'nnmail-prepare-incoming-header-hook) ! ) ;; Find the end of this article. (goto-char (point-max)) (widen) *************** *** 727,740 **** (goto-char head-end) (or (nnmail-search-unix-mail-delim) (goto-char (point-max)))) ! ;; Allow the backend to save the article. ! (save-excursion ! (save-restriction ! (narrow-to-region start (point)) ! (goto-char (point-min)) ! (nnmail-check-duplication message-id func artnum-func) ! (setq end (point-max)))) ! (goto-char end))))) (defun nnmail-process-mmdf-mail-format (func artnum-func) (let ((delim "^\^A\^A\^A\^A$") --- 731,746 ---- (goto-char head-end) (or (nnmail-search-unix-mail-delim) (goto-char (point-max)))) ! (let ((case-fold-search t)) ! ;; Allow the backend to save the article. ! (save-excursion ! (save-restriction ! (narrow-to-region start (point)) ! (goto-char (point-min)) ! (nnmail-check-duplication message-id func artnum-func) ! (setq end (point-max)))) ! (goto-char end)) ! )))) (defun nnmail-process-mmdf-mail-format (func artnum-func) (let ((delim "^\^A\^A\^A\^A$")