Gnus development mailing list
 help / color / mirror / Atom feed
From: David Moore <dmoore@UCSD.EDU>
Subject: patch for broken 0.55 nnmail-process-unix-mail-format
Date: 07 Nov 1996 18:03:42 -0800	[thread overview]
Message-ID: <rvu3r1z6kh.fsf@sdnp5.ucsd.edu> (raw)
In-Reply-To: Steven L Baur's message of 07 Nov 1996 11:44:06 -0800

> 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$")


      reply	other threads:[~1996-11-08  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-07 19:44 (Unwanted) case sensitivity in nnmail-process-unix-mail-format Steven L Baur
1996-11-08  2:03 ` David Moore [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rvu3r1z6kh.fsf@sdnp5.ucsd.edu \
    --to=dmoore@ucsd.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).