Gnus development mailing list
 help / color / mirror / Atom feed
* possible bug? or feature? with slurping DOS files under Unix
@ 2001-11-12 19:00 Ted Zlatanov
  2001-11-12 20:56 ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2001-11-12 19:00 UTC (permalink / raw)


I hesitate to post this as a bug, because it's definitely not
something you'd expect to see.  Still, I almost lost mail because of
it.

For some reason, my fetchmail started writing messages in DOS format,
with the extra ^M at the end of the file.  Gnus fetched that mail and
added "Lines: 0" and a X-Ref header at the end of the message, and
didn't show the message body itself when I selected it.

I panicked, of course, and got Gnus from CVS, but that didn't fix
anything (at this point, I just saw empty messages with ^M at the
end of every header line).  I eventually figured the problem out and
restarted fetchmail, when I hit 't' and saw the message body in
between the headers.

If this is a feature, it should be documented.  If this is a bug, I
hope it's fixed so others don't have the same fun I did :)

Thanks
Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: possible bug? or feature? with slurping DOS files under Unix
  2001-11-12 19:00 possible bug? or feature? with slurping DOS files under Unix Ted Zlatanov
@ 2001-11-12 20:56 ` Simon Josefsson
  2001-11-13  3:14   ` Samuel Padgett
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2001-11-12 20:56 UTC (permalink / raw)
  Cc: ding

Ted Zlatanov <tzz@northernlight.com> writes:

> For some reason, my fetchmail started writing messages in DOS format,
> with the extra ^M at the end of the file.  Gnus fetched that mail and
> added "Lines: 0" and a X-Ref header at the end of the message, and
> didn't show the message body itself when I selected it.

How do you fetch the mail into Gnus?  I remember patching something
recently to work around that problem, but I don't recall what exactly
or if it was committed.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: possible bug? or feature? with slurping DOS files under Unix
  2001-11-12 20:56 ` Simon Josefsson
@ 2001-11-13  3:14   ` Samuel Padgett
  2001-11-13  9:40     ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Padgett @ 2001-11-13  3:14 UTC (permalink / raw)
  Cc: Ted Zlatanov, ding

Simon Josefsson <jas@extundo.com> writes:

> I remember patching something recently to work around that
> problem, but I don't recall what exactly or if it was committed.

I think that was for me.

Sam


2001-09-15  Simon Josefsson  <jas@extundo.com>

	* nnml.el (nnml-parse-head): Handle CRLF files.
	(nnml-generate-nov-file): Ditto.
	(nnml-retrieve-headers): Ditto.

Index: nnml.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnml.el,v
retrieving revision 6.25
diff -u -u -w -u -w -r6.25 nnml.el
--- nnml.el	2001/09/08 20:55:16	6.25
+++ nnml.el	2001/09/15 21:17:19
@@ -157,7 +157,7 @@
 		(setq beg (point))
 		(nnheader-insert-head file)
 		(goto-char beg)
-		(if (search-forward "\n\n" nil t)
+		(if (re-search-forward "\n\r?\n" nil t)
 		    (forward-char -1)
 		  (goto-char (point-max))
 		  (insert "\n\n"))
@@ -713,13 +713,15 @@
       (unless (zerop (buffer-size))
 	(narrow-to-region
 	 (goto-char (point-min))
-	 (if (search-forward "\n\n" nil t) (1- (point))
(point-max))))
+	 (if (re-search-forward "\n\r?\n" nil t) (1- (point))
(point-max))))
       ;; Fold continuation lines.
       (goto-char (point-min))
       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
 	(replace-match " " t t))
       ;; Remove any tabs; they are too confusing.
       (subst-char-in-region (point-min) (point-max) ?\t ? )
+      ;; Remove any ^M's; they are too confusing.
+      (subst-char-in-region (point-min) (point-max) ?\r ? )
       (let ((headers (nnheader-parse-head t)))
 	(mail-header-set-chars headers chars)
 	(mail-header-set-number headers number)
@@ -838,7 +840,7 @@
 	  (narrow-to-region
 	   (goto-char (point-min))
 	   (progn
-	     (search-forward "\n\n" nil t)
+	     (re-search-forward "\n\r?\n" nil t)
 	     (setq chars (- (point-max) (point)))
 	     (max 1 (1- (point)))))
 	  (unless (zerop (buffer-size))



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: possible bug? or feature? with slurping DOS files under Unix
  2001-11-13  3:14   ` Samuel Padgett
@ 2001-11-13  9:40     ` Simon Josefsson
  2001-11-13 17:24       ` Samuel Padgett
  2001-11-13 17:34       ` Ted Zlatanov
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Josefsson @ 2001-11-13  9:40 UTC (permalink / raw)
  Cc: Ted Zlatanov, ding

On Mon, 12 Nov 2001, Samuel Padgett wrote:

> Simon Josefsson <jas@extundo.com> writes:
> 
> > I remember patching something recently to work around that
> > problem, but I don't recall what exactly or if it was committed.
> 
> I think that was for me.

Did it work?

Does it solve this new bug?  (Maybe they are unrelated, the patch modifies 
nnml, and it is probably too late if something earlier in the mail 
splitting stuff doesn't like CRLF as well...)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: possible bug? or feature? with slurping DOS files under Unix
  2001-11-13  9:40     ` Simon Josefsson
@ 2001-11-13 17:24       ` Samuel Padgett
  2001-11-13 17:34       ` Ted Zlatanov
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Padgett @ 2001-11-13 17:24 UTC (permalink / raw)
  Cc: Ted Zlatanov, ding

Simon Josefsson <jas@extundo.com> writes:

> On Mon, 12 Nov 2001, Samuel Padgett wrote:
> 
> > Simon Josefsson <jas@extundo.com> writes:
> > 
> > > I remember patching something recently to work around that
> > > problem, but I don't recall what exactly or if it was committed.
> > 
> > I think that was for me.
> 
> Did it work?

It worked for me.  Don't know if it will fix the original poster's
problem, though.

Sam



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: possible bug? or feature? with slurping DOS files under Unix
  2001-11-13  9:40     ` Simon Josefsson
  2001-11-13 17:24       ` Samuel Padgett
@ 2001-11-13 17:34       ` Ted Zlatanov
  1 sibling, 0 replies; 6+ messages in thread
From: Ted Zlatanov @ 2001-11-13 17:34 UTC (permalink / raw)
  Cc: Samuel Padgett, ding

Simon Josefsson <jas@extundo.com> writes:

> On Mon, 12 Nov 2001, Samuel Padgett wrote:
>
>> Simon Josefsson <jas@extundo.com> writes:
>> 
>> > I remember patching something recently to work around that
>> > problem, but I don't recall what exactly or if it was committed.
>> 
>> I think that was for me.
>
> Did it work?
>
> Does it solve this new bug?  (Maybe they are unrelated, the patch modifies 
> nnml, and it is probably too late if something earlier in the mail 
> splitting stuff doesn't like CRLF as well...)

I fetch mail with nnml.  There's definitely Lines: and xref: headers
added without interpretation of CRLF.  I was using the latest Gnus
from CVS yesterday when the problem happened.

Thanks
Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-11-13 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-12 19:00 possible bug? or feature? with slurping DOS files under Unix Ted Zlatanov
2001-11-12 20:56 ` Simon Josefsson
2001-11-13  3:14   ` Samuel Padgett
2001-11-13  9:40     ` Simon Josefsson
2001-11-13 17:24       ` Samuel Padgett
2001-11-13 17:34       ` Ted Zlatanov

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).