Gnus development mailing list
 help / color / mirror / Atom feed
* Patch needed: Defense against embedded ^M in Message-Id -- ow!
@ 2001-09-04 12:00 Karl Kleinpaste
  2001-09-04 13:50 ` Kai Großjohann
  2001-09-04 15:46 ` Paul Jarc
  0 siblings, 2 replies; 6+ messages in thread
From: Karl Kleinpaste @ 2001-09-04 12:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

I got another screwup in my spam-catcher "tomb" group this morning.
Same symptom as before, article expiry choking on an invalid numeric
comparison to `>'.  I took a closer look, and what I found is fairly
horrifying.

There are spammers out there whose messages contain a literal carriage
return character in the Message-Id header.  Take a peek below (and
maybe hit `i' twice on its MIME component to get it rendered as
text/plain).  And that's ignoring entirely the fact that the
Message-Id header looks more like a Received header in the first
place.


[-- Attachment #2: header screwup with embedded carriage return --]
[-- Type: message/rfc822, Size: 1469 bytes --]

[-- Attachment #2.1: Type: text/html, Size: 17 bytes --]

From: enrda352@hotmail.com
To: <baseball@statesmail.com>
Subject: Targeted E-Mail Marketing Lists.............       			*f
Date: Sat, 25 Aug 2001 18:19:25 -0700
Message-ID: <00004f9a34c1$00001d6e$00006e46@myrop (ew6.southwind.net [216.53.98.70]) by onyx.southwind.net from homepage.com (114.230.197.216) by newmail.spectraweb.ch from default (m202.2-25.warwick.net [218.242.202.80]) byhost.warwick.net (8.10.0.Beta10/8.10.0.Beta10) with SMTP id e9GKEKk19201\r>

[-- Attachment #3: Type: text/plain, Size: 556 bytes --]


This induces an overview file which contains 2 lines, because
somewhere along the way Gnus converts the carriage return to a
newline.  The 2nd line makes for the malformed overview entry, because
it begins with that `>'.

I would guess that what's needed for this is a patch to turn carriage
returns into bland space characters, the way that I expect all headers
have tabs converted to spaces to prevent screwing up the tab-separated
overview files.  Does anyone know precisely where this occurs?  A
quick peek at nnheader.el wasn't terribly informative.

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

* Re: Patch needed: Defense against embedded ^M in Message-Id -- ow!
  2001-09-04 12:00 Patch needed: Defense against embedded ^M in Message-Id -- ow! Karl Kleinpaste
@ 2001-09-04 13:50 ` Kai Großjohann
  2001-09-04 14:19   ` Karl Kleinpaste
  2001-09-04 15:46 ` Paul Jarc
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2001-09-04 13:50 UTC (permalink / raw)
  Cc: ding

Fwiw, I couldn't see ^M in the headers.
kai
-- 
Symbol's function definition is void: signature


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

* Re: Patch needed: Defense against embedded ^M in Message-Id -- ow!
  2001-09-04 13:50 ` Kai Großjohann
@ 2001-09-04 14:19   ` Karl Kleinpaste
  2001-09-04 17:02     ` Kai Großjohann
  0 siblings, 1 reply; 6+ messages in thread
From: Karl Kleinpaste @ 2001-09-04 14:19 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> Fwiw, I couldn't see ^M in the headers.

Message-Id, 2nd-to-last character, column 296.
(Unless your transport re-routed that character into oblivion.)
It's there in my received-from-list copy.


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

* Re: Patch needed: Defense against embedded ^M in Message-Id -- ow!
  2001-09-04 12:00 Patch needed: Defense against embedded ^M in Message-Id -- ow! Karl Kleinpaste
  2001-09-04 13:50 ` Kai Großjohann
@ 2001-09-04 15:46 ` Paul Jarc
  2001-09-04 16:05   ` Paul Jarc
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Jarc @ 2001-09-04 15:46 UTC (permalink / raw)


Karl Kleinpaste <karl@charcoal.com> wrote:
> There are spammers out there whose messages contain a literal carriage
> return character in the Message-Id header.
...
> Message-ID: <00004f9a34c1$00001d6e$00006e46@myrop (ew6.southwind.net [216.53.98.70]) by onyx.southwind.net from homepage.com (114.230.197.216) by newmail.spectraweb.ch from default (m202.2-25.warwick.net [218.242.202.80]) byhost.warwick.net (8.10.0.Beta10/8.10.0.Beta10) with SMTP id e9GKEKk19201\r>

Eww.  That's ugly, all right.

> I would guess that what's needed for this is a patch to turn carriage
> returns into bland space characters, the way that I expect all headers
> have tabs converted to spaces to prevent screwing up the tab-separated
> overview files.

I just fixed this same bug in the last version of nnmaildir.  It's ok
to leave the carriage returns unchanged, but to prevent them from
becoming newlines, you have to do this:
(let ((nnheader-file-coding-system 'binary) ...) ...)
when writing your NOV file.


paul


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

* Re: Patch needed: Defense against embedded ^M in Message-Id -- ow!
  2001-09-04 15:46 ` Paul Jarc
@ 2001-09-04 16:05   ` Paul Jarc
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Jarc @ 2001-09-04 16:05 UTC (permalink / raw)


I wrote:
> I just fixed this same bug in the last version of nnmaildir.  It's ok
> to leave the carriage returns unchanged, but to prevent them from
> becoming newlines, you have to do this:
> (let ((nnheader-file-coding-system 'binary) ...) ...)
> when writing your NOV file.

Er, when *reading* the NOV file.  And assuming you're using
nnheader-insert-file-contents to do it.

In the cases I found, the carriage returns would be preserved when the
message file was read, because there were some lines that didn't have
them, so the magic coding-system stuff didn't kick in.  They were also
written correctly to the NOV file, but then when they were reread,
there were only carriage returns and no newlines, so carriage return
was converted to newline.

Hm.  But other backends' NOV files *do* have newlines.  So maybe the
fix will be slightly different.


paul


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

* Re: Patch needed: Defense against embedded ^M in Message-Id -- ow!
  2001-09-04 14:19   ` Karl Kleinpaste
@ 2001-09-04 17:02     ` Kai Großjohann
  0 siblings, 0 replies; 6+ messages in thread
From: Kai Großjohann @ 2001-09-04 17:02 UTC (permalink / raw)
  Cc: ding

Karl Kleinpaste <karl@charcoal.com> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> > Fwiw, I couldn't see ^M in the headers.
>
> Message-Id, 2nd-to-last character, column 296.
> (Unless your transport re-routed that character into oblivion.)
> It's there in my received-from-list copy.

Something was `friendly' enough to remove it.  I did `o' on the part and
then looked in the file -- no ^M there.

kai
-- 
Symbol's function definition is void: signature


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

end of thread, other threads:[~2001-09-04 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-04 12:00 Patch needed: Defense against embedded ^M in Message-Id -- ow! Karl Kleinpaste
2001-09-04 13:50 ` Kai Großjohann
2001-09-04 14:19   ` Karl Kleinpaste
2001-09-04 17:02     ` Kai Großjohann
2001-09-04 15:46 ` Paul Jarc
2001-09-04 16:05   ` Paul Jarc

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