nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Selecting messages with a range of Spam scores

2015-02-21 09:22:47
David Levine <levinedl(_at_)acm(_dot_)org> writes:
Norm wrote:

But the best way to get the message numbers having such a component,
WITH the corresponding contents of the component is not obvious to
me.

Some variation of (assuming bash and GNU grep):

msgs=last:45
for i in $(pick $msgs --X-Spam-Status score=); do
[ $i -ne 0 ] && \
grep --with-filename --ignore-case ^X-Spam-Status $(mhpath $i)
done

Thank you very much.

Looks like that will do it, if I add '--max-count=1' to the grep arguments (in
case the message body contains any lines starting with X-Spam-Status) and
provided that the relevant component is not multi-lined. I don't think that
that component is ever multi-lined.

Your reply strong suggests that there is presently no nmh way of extracting
the content of a component, taking account of multi-lined , MIME stuff, etc.

Again, thank you most kindly.



    Norman Shapiro

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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