[conspire] mailgrep/grepmail/mboxgrep

Michael Paoli Michael.Paoli at cal.berkeley.edu
Thu Oct 22 16:13:14 PDT 2020


Thanks.

Yes, I should've checked/searched ... perhaps I did long ago,
but obviously not recently. 8-O

And yes, multiple solutions:
$ cmp <(mailgrep 'joker\.com' sf-lug.mbox | tee >(1>&2 wc -c))  
<(grepmail 'joker\.com' sf-lug.mbox) && echo MATCHED
494293
MATCHED
$ cmp <(mailgrep 'joker\.com' sf-lug.mbox) <(mboxgrep 'joker\.com'  
sf-lug.mbox) && echo MATCHED
MATCHED
$

grepmail is much more capable, notably in terms of features/options,
compared to mboxgrep - which is much more basic/simplistic.
Also, however, mboxgrep is much lighter in dependencies - notably not
requiring perl, whereas  grepmail requires perl.

What I'd happened to be looking for was:
http://linuxmafia.com/pipermail/sf-lug/2020q2/014825.html
(basically the summary, and details/background of why not joker.com)
and being able to fairly quickly find Date: and Subject: from
the specific email then made finding the specific URL in the
archives much quicker and easier.

> From: "Tony Godshall" <togo at of.net>
> Subject: Re: [conspire] mailgrep
> Date: Wed, 21 Oct 2020 14:12:56 -0700

> see also
> https://packages.debian.org/unstable/grepmail
>
>
> On Wed, Oct 21, 2020 at 2:24 AM Michael Paoli <
> Michael.Paoli at cal.berkeley.edu> wrote:
>
>> mailgrep - a teensy weensy tiny program that does something
>> rather useful ... that I should've coded up years ago (maybe
>> I did ... somewhere ... but didn't keep it?  Or just did
>> it as a one-off for some particular set of matching I was
>> looking for - I'm sure I've done that more than once).
>>
>> Thus far very bare-bones basic.
>>
>> The issue/challenge/problem it solves.
>>
>> Let's say you have a file in mbox format.
>> Let's say rather than line-oriented grep, you want to extract all the
>> mail messages that match some particular pattern.
>>
>> Well, mailgrep will do that.  Just bare bones functionality thus far.
>> It uses perl regular expressions (which are an extension of BRE & ERE).
>> Basic usage:
>> mailgrep RE [file ...]
>> And, where, can you find the program?
>> At least presently here:
>> https://www.balug.org/~sflug/bin/mailgrep




More information about the conspire mailing list