procmail
[Top] [All Lists]

RE: Fixing up broken headers how?

2001-12-26 11:29:09


-----Original Message-----
From: procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE]On Behalf Of 
Trevor Jenkins
Sent: Wednesday, December 26, 2001 3:20 AM
To: procmail Users List
Subject: RE: Fixing up broken headers how?


On Tue, 25 Dec 2001, Gary Funck <gary(_at_)intrepid(_dot_)com> wrote:

Occasionally I receive messages from a list where the
original was gated
through a news server. Some (but not all) of these message arrive with
damaged headers such that most of the header lines are taken
as body text.
I'd like to fix up these message so that they have correct headers.

You might try seeing if the "digest split" option on formail
will help. ...

  formail +1 -ds < msg.001 > msg.fixed

Then, take a look at msg.fixed to see if that's what you expect
to see in a
repaired message.

Although it alerted me to features (the -d and -s option) of
procmail/formail I was unaware of it doesn't solve the problem. Using the
+1 option resulted in a nothing being written to the output.

Here's a fragment of the latest of these damaged messages. (Only change is
to alter the address of the original author.)

From trevor(_at_)suneidesis(_dot_)com Wed Dec 26 10:54:35 2001 +0000
Return-Path: <bounce-tools-forum-41233(_at_)news(_dot_)palmos(_dot_)com>
Received: from punt-11.mail.demon.net (punt-11.mail.demon.net
[194.217.242.34])
      by suneidesis.demon.co.uk (8.9.3/8.9.3) with SMTP id KAA14452
      for <trevor(_dot_)jenkins(_at_)suneidesis(_dot_)com>; Wed, 26 Dec 2001 
10:54:33 GMT
Date: Wed, 26 Dec 2001 10:54:33 GMT
From: bounce-tools-forum-41233(_at_)news(_dot_)palmos(_dot_)com
Message-Id: 
<200112261054(_dot_)KAA14452(_at_)suneidesis(_dot_)demon(_dot_)co(_dot_)uk>
Received: from punt-1.mail.demon.net by mailstore
          for trevor(_dot_)jenkins(_at_)suneidesis(_dot_)com id 
1009338895:10:10390:2;
          Wed, 26 Dec 2001 03:54:55 GMT
Received: from saswh047.palm.com ([205.141.210.153]) by
punt-1.mail.demon.net
           id aa1128123; 26 Dec 2001 3:54 GMT

:
From: "original author " <someone(_at_)suneidesis(_dot_)com>
Newsgroups: tools-forum
Subject: Re: source code for Palm OS 4.0 Note Pad app' available?
Date: Tue, 25 Dec 2001 00:37:39 -0500

and so on through the remaining headers and body text. I tried increasing
the minfields counter, using the -z option, and dropping the +1 but the
re-processed message is identical to the original.


Ah, okay. That single colon (":") preceding the "From:" line in the body of
the message may be gumming up the works. Typically, formail looks for a
blank line to precede the header fields when splitting out digests. We can
override that behavior, with the "-e" switch:

       -e   Do not require empty lines to be preceding the header
            of a new message (i.e.  the messages could  start  on
            every line).

I added a single line to the end of your test message above, so that there
was a "body" to the re-mailed newsgroup article, for the purposes of
testing.  Here's what I've got:

---- begin ----
From trevor(_at_)suneidesis(_dot_)com Wed Dec 26 10:54:35 2001 +0000
Return-Path: <bounce-tools-forum-41233(_at_)news(_dot_)palmos(_dot_)com>
Received: from punt-11.mail.demon.net (punt-11.mail.demon.net
[194.217.242.34])
        by suneidesis.demon.co.uk (8.9.3/8.9.3) with SMTP id KAA14452
        for <trevor(_dot_)jenkins(_at_)suneidesis(_dot_)com>; Wed, 26 Dec 2001 
10:54:33 GMT
Date: Wed, 26 Dec 2001 10:54:33 GMT
From: bounce-tools-forum-41233(_at_)news(_dot_)palmos(_dot_)com
Message-Id: 
<200112261054(_dot_)KAA14452(_at_)suneidesis(_dot_)demon(_dot_)co(_dot_)uk>
Received: from punt-1.mail.demon.net by mailstore
          for trevor(_dot_)jenkins(_at_)suneidesis(_dot_)com id 
1009338895:10:10390:2;
          Wed, 26 Dec 2001 03:54:55 GMT
Received: from saswh047.palm.com ([205.141.210.153]) by
punt-1.mail.demon.net
           id aa1128123; 26 Dec 2001 3:54 GMT


:
From: "original author " <someone(_at_)suneidesis(_dot_)com>
Newsgroups: tools-forum
Subject: Re: source code for Palm OS 4.0 Note Pad app' available?
Date: Tue, 25 Dec 2001 00:37:39 -0500

This is the body of re-mailed news article.
---- end ----

I copied this to a file named tst.mail, and ran the following command:
     formail +1 -des < tst.mail

Here's what came out:

---- begin ----
From someone(_at_)suneidesis(_dot_)com  Wed Dec 26 10:18:39 2001
From: "original author " <someone(_at_)suneidesis(_dot_)com>
Newsgroups: tools-forum
Subject: Re: source code for Palm OS 4.0 Note Pad app' available?
Date: Tue, 25 Dec 2001 00:37:39 -0500

This is the body of re-mailed news article.
---- end ----



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>