[nmh-workers] burst behavior

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[nmh-workers] burst behavior

Paul Fox-3
I'm on a list which, for historical reasons, is available only
in digest form.  (Sigh.)

Like many digests, it includes hyphen-rich separator lines in the
trailing text of the digest, causing burst to create a flurry of
malformed messages when it parses according to RFC 934.  Hoping for
the digest creators to start honoring 934 (or convert to mime!) at
this point is clearly just wishful thinking.

An obvious fix (for me) is to pre-process the digest, and
hyphen-escape all lines which follow the "END OF DIGEST" line and
which begin with a '-', by adding an extra '- ' at the start of line.
If I do that, then burst will do the right thing, and ignore all of the
trailer text.

Is there a better/easier way to handle this?

If I were to become extra-ambitious, and create a patch which added a
"-endofdigest" switch which did something similar, would there be
interest?

I think the new code would be something like:
    If the first non-whitespace text after a hyphen separator line is
    a case-insensitive match on "END OF [^ ]* DIGEST.*", then start
    ignoring hyphen separator lines.

paul
=----------------------
 paul fox, [hidden email] (arlington, ma, where it's 69.4 degrees)


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: burst behavior

Ralph Corderoy
Hi Paul,

> An obvious fix (for me) is to pre-process the digest, and
> hyphen-escape all lines which follow the "END OF DIGEST" line and
> which begin with a '-', by adding an extra '- ' at the start of line.
> If I do that, then burst will do the right thing, and ignore all of
> the trailer text.

Isn't it simpler to

    sed '/^- *END OF [^ ]* DIGEST/q'

if you're preprocessing?  If your sed has -i then you could run it on
the digest first to do the change in situ.

--
Cheers, Ralph.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: burst behavior

Paul Fox-3
ralph wrote:
 > Hi Paul,
 >
 > > An obvious fix (for me) is to pre-process the digest, and
 > > hyphen-escape all lines which follow the "END OF DIGEST" line and
 > > which begin with a '-', by adding an extra '- ' at the start of line.
 > > If I do that, then burst will do the right thing, and ignore all of
 > > the trailer text.
 >
 > Isn't it simpler to
 >
 >     sed '/^- *END OF [^ ]* DIGEST/q'
 >
 > if you're preprocessing?  If your sed has -i then you could run it on
 > the digest first to do the change in situ.

Yes, it certainly would be easier.  (Too many trees -- where's the
forest??)  In fact, a few minutes before posting I thought to myself,
"I'll bet Ralph replies with a one-liner for this."  :-)

paul
=----------------------
paul fox, [hidden email] (arlington, ma, where it's 71.2 degrees)


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: burst behavior

Ken Hornstein-2
In reply to this post by Paul Fox-3
>If I were to become extra-ambitious, and create a patch which added a
>"-endofdigest" switch which did something similar, would there be
>interest?

Yes ... but I would personally prefer if it was more generic.  Like
if the -endofdigest switch took a regular expression, because as far
as I can tell there is no standard when it comes to digest format
nowadays (sigh).

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: burst behavior

Ralph Corderoy
Hi Ken,

> Yes ... but I would personally prefer if it was more generic.  Like if
> the -endofdigest switch took a regular expression

That's an improvement.  An alternative is a -preproc that took a command
that preprocessed each MIME-decoded part before being read for bursting;
only used in -nomime's case.

--
Cheers, Ralph.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers