On Fri, 14 Nov 1997 08:54:57 -0500,
Adam Grove <grove(_at_)research(_dot_)nj(_dot_)nec(_dot_)com> wrote:
:0Bi
toplines=| head -$N # sed ${N}q if you don't have head
Thanks. Extracting a varible like "toplines" will work just
as in your example in a number of cases I have in mind.
[But] I really wanted to match the truncated body against various
scoring recipes rather than true/false tests. Is there a way of
doing this?
Sure you can.
:0
* $ 1^1 toplines ?? pattern
* $ 1^1 toplines ?? pattern2
:
etc
<... snipped recipes to grab top N lines into MATCH ...>
Won't this be a danger on non-text or badly formatted messages?
(I.e, might overrun linebuf, since there's no a priori bound
on how long the first "line" in a message might be.)
With "head" I can extract a specified number of bytes.
SMTP messages can have at most 1000 bytes per line, but don't count on
it. Obviously, people are using badly written mail readers which don't
wrap the lines for them, otherwise it might be a good idea to ditch
all such messages as spam :-)
If you actually go ahead and implement a recipe generator, that would
remove the obstacles involved with using recipes such as
:0
* ^^\/.(.)?(.)?(.)?(.)?(.)? [... etc ...] (.)?$\
(.)?(.)?(.)?(.)?(.)?(.)? [... etc ...] (.)?$?\
(.)?(.)?(.)?(.)?(.)?(.)? [... etc ...] (.)?$?\
:
Of course, anything like this is going to hit LINEBUF long before the
message you are actually trying to look at :-)
/* era */
--
Paparazzi of the Net: No matter what you do to protect your privacy,
they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>