Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A decent search option for alpine

989 views
Skip to first unread message

Howard Schwartz

unread,
Apr 20, 2013, 11:40:19 AM4/20/13
to
Pine has been missing one of the most useful option for users, ``for
centuries". Most email clients created in the last 15 years or so, have
a way to search for text within the 3 major header titles and the body
simultaneously:

From: ???
To ???
Date ???

Message body ?????

Then can even rearrange your files by, for instance, all emails From: Mr
Smith

In other words one can search for all messages from Manny Tomkins sent
before 20012 that contain the words ``find me of you can'' in the message
body.

Pine can do this, one field at a time using the ; command amd tunneling
down to the text body then using the w command. But is a terribly awkward
slow, and with a lot of email, almost impossible.


A search ability like this is never likeley to be added to pine. So what
are the rest of os drowning in old emails to do. There are several
strategies possible:

A few programs of late are free (e.g. Mailstore) quickly archive and
compress emails into their own database format, and then offer powerful
searches of messages once in the archive. The pricie Mailbag Assistant
has offered this for years.

A similar strategy is to convert alpine's somewhat unusual, partially
binary, format for mail messages to another popular format, and then use
the search abilities of thunderbird or similar search friendly client.

Another strategy is to send your saved mail back to for instance googl
mail, make them imap messages again and use google's powerful online
searching to do the job.

I change alpine's message format manually with editing tools. I have had
uneven luck with mailutil in to regard.

All these strategies require changning the format of alpine messages. I
know of no other software that uses, or can work with alpine's way of
supplying an ``unusual number'' to list the number of bytes of each
message.

Michael Black

unread,
Apr 20, 2013, 11:56:36 PM4/20/13
to
I don't get this part. There's never been a time since 1996 when I
couldn't look at email useable by pine as simply text. Indeed, I was
going to suggest searching the folders with some search device. FOr
instance, I tend to use lynx not only for browsing, but as a navigator
around my own computer, and it has a search function. Just last week I
used it to find a specific email, because I remembered a phrase in a
specifc email, and searched for that.

I have no idea what you mean by "somewhat unusual" or "partially binary",
because I've never seen anything of either.

Linux is loaded with tools for searching, and while they won't so easily
spit out the specific message, they will find the message, and then you
deal with it some other way.

MIchael

rkfb

unread,
Apr 21, 2013, 12:48:04 PM4/21/13
to
Just interested how you browse/search your computer with lynx...I'm
running twm on slackware so this may be quite useful.

regards,
--
rkfb


Michael Black

unread,
Apr 21, 2013, 2:12:55 PM4/21/13
to
On Sun, 21 Apr 2013, rkfb wrote:

> Just interested how you browse/search your computer with lynx...I'm running
> twm on slackware so this may be quite useful.
>
When I first started using Pine, it was at the Montreal Freenet (that
lasted only four months, after three years of waiting). We'd dial in, and
then lynx would be launched. If pine was needed for email or newsgroups,
it was invoked by Lynx.

So instead of a shell on a Unix or Linux system, there was lynx. And
while it's a great browser, it was actually intended for this sort of
thing on a "mainframe". SO there are endless options, some disabled as
default, in the configuration. You can invoke an editor to edit files
(and choose which editor to invoke) you can run programs from it
(something I've never done). I got used to lynx at that point (when I had
to go to a commercial ISP, I went with one of the few that offered shell
access, and I continued to use my computer as a terminal emulator, running
Pine and Lynx at the ISP's server, and that went on for years), so by the
time I finally installed Linux, I was used to lynx as a filesystem
browser. I could use MC, but by the time I could run it on my own system,
I'd gotten really used to lynx.

I don't know where to start. Lynx has a search function, invoked by "/",
and I just use it automatically. If you point lynx at a directory, like
your home directory, then you see the directory and can move to
subdiretories or display files (they don't have to be html). YOu can
configure Lynx to display graphics with an external graphics viewer, I use
zgv while in console mode, the options open up if you run Lynx from a
gui desktop, So if I look through the directory and there's a jpg
pressing return opens up zgv and you can see the photo. Indeed, I
configured it that way initially so I oculd view graphics on the web, it's
not as "neat" as with a graphic browser that shows the text and the
graphics at the same time, but it doesn't show useless graphics while you
can easily select what graphics you want to view. (Before I did that
configuration, the default for lynx was to be able to download a graphic
file, and then use separately view it with a graphic viewer, this just
makes it much easier). A lot of it is spelled out in the lynx config file
which is /etc/lynx.cfg, at least in Slackware.

It's been 17 years since I first used lynx, and there's still a lot of
stuff that I've never even looked into.

Michael

Howard Schwartz

unread,
Apr 22, 2013, 7:41:31 AM4/22/13
to
Michael Black <et...@ncf.ca> wrote in
news:alpine.LNX.2.02.1...@darkstar.example.org:

> There's never been a time since 1996 when I
> couldn't look at email useable by pine as simply text.

A pine file, folder (or messagebox) containing, for example, 10 messages,
is indeed 99% plain text. You can search the entire file for a text
string, using Linux or Unix tools such as grep, awk, perl, sed, vi and so
on.

What you can NOT do easily or at all are the following:

a) search this file for the MESSAGE containing this text string.
(for instance the string, ``howard schwartz'' is the 5th line in the
text body of the 4 message in this file. ``howard schwartz'' is part
of part of the ``Subject:'' line within the header of the 3rd message in
this file.

b) Find which of all the messages From: Howard contains the word
``schwartz'' in the text body

c) List and display all messages with the ``Subject:'' pine


On other words, Unix search tools search for Lines containing a string,
not messages containing that string. Or messages containing string XXX in
the subject line and string YYY in the From one

In fact, I usually use an expanded windows version of grep (Astrogrep) to
search for pine messages I am looking for as best I can. It is true that
many unix tools can also do boolean AND or OR searches such as /^From:.
*string\|To:.*string2/ But it is time consuming and awkward to construct
regular expressions for search for the types of text in email messages.

Each file containing pine messages is partially binary in that it begins
with the marker mbx followed by a series of binary null characters, and
each message on a file with pine messages starts with a Date line like
this:

Delivery-date: Mon, 07 Feb 2011 08:37:31 -0800


at the end of which is (what I call) a binary representation of the exact
number of bytes on that message. I forget if the calcalculation reverse
hex or whatever. But it is NOT an ordinary text number (-0800 does not
mean the following message has 800 or 0800 bytes.

Must other email clients contain a template like this:

From: To:
Date Range: Subject:

Body:


Making it easy to do and AND OR type search for a message containing
one or more text strings in one or more message fields.

The difference in ease of use between these two types of searches is
astronomical!

Howard Schwartz

unread,
Apr 22, 2013, 7:45:11 AM4/22/13
to
rkfb <rk...@imap.gmail.com> wrote in news:alpine.LNX.2.02.1304211646120.2599
@openbox.slacknet:

> Just interested how you browse/search your computer with lynx...I'm
> running twm on slackware so this may be quite useful.

You load an entire pine message file into lynx as if it were a large web
page like this %lynx file://path/filename <ENTER>

Then you search for a text string using the /string <ENTER> command.
It would seem easier to use an ordinary editor like vi to do the same
thing.

unruh

unread,
Apr 22, 2013, 10:47:54 AM4/22/13
to
On 2013-04-22, Howard Schwartz <howa...@gmail.com> wrote:
> Michael Black <et...@ncf.ca> wrote in
> news:alpine.LNX.2.02.1...@darkstar.example.org:
>
>> There's never been a time since 1996 when I
>> couldn't look at email useable by pine as simply text.
>
> A pine file, folder (or messagebox) containing, for example, 10 messages,
> is indeed 99% plain text. You can search the entire file for a text
> string, using Linux or Unix tools such as grep, awk, perl, sed, vi and so
> on.
>
> What you can NOT do easily or at all are the following:
>
> a) search this file for the MESSAGE containing this text string.
> (for instance the string, ``howard schwartz'' is the 5th line in the
> text body of the 4 message in this file. ``howard schwartz'' is part
> of part of the ``Subject:'' line within the header of the 3rd message in
> this file.

egrep '^Subject:|howard schwartz" /var/spool/mail
will list the subjects of all of the files and the desired text after
it, so you at least know who it is from

Or use awk or perl.


>
> b) Find which of all the messages From: Howard contains the word
> ``schwartz'' in the text body

Similarly
>
> c) List and display all messages with the ``Subject:'' pine

egrep '^Subject:.*pine' /var/spool/mail/donald_duck

>
>
> On other words, Unix search tools search for Lines containing a string,
> not messages containing that string. Or messages containing string XXX in
> the subject line and string YYY in the From one

egrep, awk, perl.


>
> In fact, I usually use an expanded windows version of grep (Astrogrep) to
> search for pine messages I am looking for as best I can. It is true that
> many unix tools can also do boolean AND or OR searches such as /^From:.
> *string\|To:.*string2/ But it is time consuming and awkward to construct
> regular expressions for search for the types of text in email messages.

So, it has gone from "impossible" to "time consuming and awkward" Note
that the latter depends on how often you do it. The first time it is
time consuming and awkward, the 10th it is second nature.

>
> Each file containing pine messages is partially binary in that it begins
> with the marker mbx followed by a series of binary null characters, and
> each message on a file with pine messages starts with a Date line like
> this:
>
> Delivery-date: Mon, 07 Feb 2011 08:37:31 -0800

??? No idea what you mean. My pine messages do not look like that but
then you may have some option selected that I do not.


>
>
> at the end of which is (what I call) a binary representation of the exact
> number of bytes on that message. I forget if the calcalculation reverse
> hex or whatever. But it is NOT an ordinary text number (-0800 does not
> mean the following message has 800 or 0800 bytes.
>
> Must other email clients contain a template like this:
>
> From: To:
> Date Range: Subject:
>
> Body:
>
>
> Making it easy to do and AND OR type search for a message containing
> one or more text strings in one or more message fields.
>
> The difference in ease of use between these two types of searches is
> astronomical!
>

?? I think you are living in a preCopernican world if that is your
estimate of "astronomical".


Michael Black

unread,
Apr 22, 2013, 12:47:03 PM4/22/13
to
On Mon, 22 Apr 2013, unruh wrote:

>> In fact, I usually use an expanded windows version of grep (Astrogrep) to
>> search for pine messages I am looking for as best I can. It is true that
>> many unix tools can also do boolean AND or OR searches such as /^From:.
>> *string\|To:.*string2/ But it is time consuming and awkward to construct
>> regular expressions for search for the types of text in email messages.
>
> So, it has gone from "impossible" to "time consuming and awkward" Note
> that the latter depends on how often you do it. The first time it is
> time consuming and awkward, the 10th it is second nature.
>
I can do a search on something I remember, and then scroll back a bit to
find the subject header (and date), then move to Pine and with the
subject and date get the specific message that way.

You're right, if I had a lot of need for this,
it would be time to expend effort on something more automatic.

But you're right also, have some search for the subject header, then
search the following text for the keywords, if there's a match, display
the header and some of the message, if there's no match, continue
searching for the next subject header, and then drop into the subroutine
that searches the content of the email.

I'm not sure about passing information back to Pine, but one could
probably inovke the search script from within Pine, and if it could pass
back information, then the cursor would be on that message.

Michael

Michael Black

unread,
Apr 22, 2013, 12:49:02 PM4/22/13
to
But lynx can browse the directory, not just specific files. I'm used to
it, so it makes no sense to use MC for much of the same sort of thing. I
am very used to the search function in lynx, so I use it. But even if I
used a text editor for searching, as I said, lynx can invoke the text
editor of your choice to operate on the file you're already pointing at.

Michael

Howard Schwartz

unread,
Apr 22, 2013, 4:53:31 PM4/22/13
to
> But even if I
> used a text editor for searching, as I said, lynx can invoke the text
> editor of your choice to operate on the file you're already pointing
> at

I do not wish to be impolite - but you have not addressed any of the
points I made. Lynx or ANY editor finds only LINES in a file that
contain some text, not MESSAGES that contain text.

It is not POSSIBLE for lynx or an editor to find a message that contains
multiple pieces of text. This is because they are limited to finding,
even several pieces of text only within a SINGLE LINE, not in multiple
lines (within one message).

This makes them almost completely inadequate for locating messages.

Lynx and editors have no concept of the the text object called
``message'' and can therefore not work with this object in practical
ways.



===========
By contrast any email search engine can easily locate, for instance,

all email messages sent since the Date: 2009, From: the newsgroup
comp.mail.pine that have information on the Subject: email
search engines

Howard Schwartz

unread,
Apr 22, 2013, 5:29:50 PM4/22/13
to
unruh <un...@invalid.ca> wrote in news:u4cdt.274$t95...@newsfe31.iad:

> egrep '^Subject:|howard schwartz" /var/spool/mail
> will list the subjects of all of the files and the desired text after
> it, so you at least know who it is from

With some mistakes now and then. For instance. in some text lines like


To: President BRown

From: Howard Bert

Subject: Agenda for the next meeting


egrap will believe the subject of the whole mail message is ``Agenda fr
the next meeting''


Since egrep does not know anything about the structure of an email
message (as a type of text object) it will mistake parts of text for
parts of the actual email message (e.g., it has no knowledge of Subject:
as a email header keyword).
a

unruh

unread,
Apr 22, 2013, 7:03:47 PM4/22/13
to
On 2013-04-22, Howard Schwartz <howa...@gmail.com> wrote:
> Michael Black <et...@ncf.ca> wrote in
> news:alpine.LNX.2.02.1...@darkstar.example.org:
>
>> But even if I
>> used a text editor for searching, as I said, lynx can invoke the text
>> editor of your choice to operate on the file you're already pointing
>> at
>
> I do not wish to be impolite - but you have not addressed any of the
> points I made. Lynx or ANY editor finds only LINES in a file that
> contain some text, not MESSAGES that contain text.
>
> It is not POSSIBLE for lynx or an editor to find a message that contains
> multiple pieces of text. This is because they are limited to finding,
> even several pieces of text only within a SINGLE LINE, not in multiple
> lines (within one message).
>
> This makes them almost completely inadequate for locating messages.
>
> Lynx and editors have no concept of the the text object called
> ``message'' and can therefore not work with this object in practical
> ways.

While partially true, almost all search engines do have the ability to
do conditional searches. Ie, they can be taught what a message body is,
and which headers they are associated with. Thus it IS possible for them
to do what you claim to be impossible. As I suggesed use awk for example
to set up a search. You could even make it a script so you could feed it
with what you need.

unruh

unread,
Apr 22, 2013, 7:11:13 PM4/22/13
to
On 2013-04-22, Howard Schwartz <howa...@gmail.com> wrote:
> unruh <un...@invalid.ca> wrote in news:u4cdt.274$t95...@newsfe31.iad:
>
>> egrep '^Subject:|howard schwartz" /var/spool/mail
>> will list the subjects of all of the files and the desired text after
>> it, so you at least know who it is from
>
> With some mistakes now and then. For instance. in some text lines like

So what. It is easy for you to week out those mistakes. If you want to
write some foolproof search engine go ahead. But I thought you wanted to
find certain emails which matched certtain criteria without looking
throug the whole inbox or pine folder by hand.

>
>
> To: President BRown
>
> From: Howard Bert
>
> Subject: Agenda for the next meeting
>
>
> egrap will believe the subject of the whole mail message is ``Agenda fr
> the next meeting''

And isn't it?


>
>
> Since egrep does not know anything about the structure of an email
> message (as a type of text object) it will mistake parts of text for
> parts of the actual email message (e.g., it has no knowledge of Subject:
> as a email header keyword).

Ssure it does. You teach it.

My suggestion above would list all Subject: lines, and after that all
lines which contained howard schwartz. It is easy for you to link them
together.
Is your desire to complain, or is your desire to find certain email
messages. Let us know. If the former we can stop trying to help, and let
you go on with your complaining. If the latter we may try to help.





Howard Schwartz

unread,
Apr 23, 2013, 3:04:01 AM4/23/13
to
unruh <un...@invalid.ca> wrote in news:nljdt.6984$X11....@newsfe30.iad:

> While partially true, almost all search engines do have the ability to
> do conditional searches. Ie, they can be taught what a message body
> is, and which headers they are associated with. Thus it IS possible
> for them to do what you claim to be impossible. As I suggesed use awk
> for example to set up a search. You could even make it a script so you
> could feed it with what you need.

Partial agreement here, although each of plays a bit with words (note
my cavete ``in practical ways'').

To bring the discussion up a level and hopefully more simple: Most
`modern' email clients have a search facility that deals quite directly
and easily with `messages. Pine/alpine does not. I merely suggest some
third party tools that can be used to operate on Pine's messages, better
than Pine can.

Unix tools have always been famous for, with sufficient options,
scripting etc. - being able to handle all kinds of special cases and
situatios. Witness the infamous unix `find' command that could probably
find one's grandmother's slippers, given sifficient command like
arguments.

For cases like email messages, I prefer tools that are already pre-built
to operate on these objects. I list a few for the like-minded. Those
that prefer general tools are welcome to do so. I am expert in regular
expressios awk, sed and similar languages that manipulate text. In this
case, I find a lot more can be done with the prebuilt tools, much easier
and quicker. No need really for `impossibility arguments'' But do try
say. Mailbag assistant and see what can be done almost instantly.

Lucas Levrel

unread,
Apr 23, 2013, 4:11:02 AM4/23/13
to
Le 22 avril 2013, Howard Schwartz a écrit :

> Each file containing pine messages is partially binary in that it begins
> with the marker mbx followed by a series of binary null characters, and
> each message on a file with pine messages starts with a Date line like
> this:
>
> Delivery-date: Mon, 07 Feb 2011 08:37:31 -0800
>
>
> at the end of which is (what I call) a binary representation of the exact
> number of bytes on that message. I forget if the calcalculation reverse
> hex or whatever. But it is NOT an ordinary text number (-0800 does not
> mean the following message has 800 or 0800 bytes.

I don't have this format either, but it seems obvious to me that "-0800"
here is the offset from GMT (-8 hours)!

--
LL

unruh

unread,
Apr 23, 2013, 11:56:53 AM4/23/13
to
On 2013-04-23, Howard Schwartz <howa...@gmail.com> wrote:
> unruh <un...@invalid.ca> wrote in news:nljdt.6984$X11....@newsfe30.iad:
>
>> While partially true, almost all search engines do have the ability to
>> do conditional searches. Ie, they can be taught what a message body
>> is, and which headers they are associated with. Thus it IS possible
>> for them to do what you claim to be impossible. As I suggesed use awk
>> for example to set up a search. You could even make it a script so you
>> could feed it with what you need.
>
> Partial agreement here, although each of plays a bit with words (note
> my cavete ``in practical ways'').
>
> To bring the discussion up a level and hopefully more simple: Most
> `modern' email clients have a search facility that deals quite directly
> and easily with `messages. Pine/alpine does not. I merely suggest some
> third party tools that can be used to operate on Pine's messages, better
> than Pine can.

Agreed. It would be nice if Pine could do search within text, instead of
only search exactly what is printed on the screen (no idea how they do
that-- limit the search to only what is on the screen, so that if a
message has
From: Norman Skrdovitch Costelain
and what appears on the screen is just
From: Norman Skrdovi
then it will fail looking for Skradovitch
).

But that is a different question as to whether or not Linux can search
through a mail folder (eg INBOX) to find stuff. It can. But I do agree
that a search function in pine there was a bit more intelligent would
certainly be nice.

>
> Unix tools have always been famous for, with sufficient options,
> scripting etc. - being able to handle all kinds of special cases and
> situatios. Witness the infamous unix `find' command that could probably
> find one's grandmother's slippers, given sifficient command like
> arguments.
>
> For cases like email messages, I prefer tools that are already pre-built
> to operate on these objects. I list a few for the like-minded. Those
> that prefer general tools are welcome to do so. I am expert in regular
> expressios awk, sed and similar languages that manipulate text. In this
> case, I find a lot more can be done with the prebuilt tools, much easier
> and quicker. No need really for `impossibility arguments'' But do try
> say. Mailbag assistant and see what can be done almost instantly.

There is a certain "kithen sink" mentality about the mail clients
however-- ie bloated with "nice featers someone (one of the writers?)
may want. One does not want Pine turning into Microsoft Word either.

unruh

unread,
Apr 23, 2013, 12:17:16 PM4/23/13
to
Actually, I have just discovered that pine CAN do a search through the
text of the message body, and of the full addresses, etc.

Do a selection ";"
select Text "T"
select All "A"
and it will search the whole body of the text message for the text to
select. You can then do
";" again and select "N" (Narrow selection) and choose "T" and "F" to
only mark those messages which are from a certain user as well, etc.

The just look at those messages with an X in front of the displayed
line.
Not sure how you can jump from one marked text to the next.

So you can use pine to search, via this somewhat convoluted path.

Hart Larry

unread,
Apr 23, 2013, 2:39:25 PM4/23/13
to
Well many years ago when Pine 3.96 was around, I was able to search quite
easily-and-rapidly through even a binary news-group. But then Pine switched to
4.02 and while loading larger groups got better, searches within a single
current group became much slower. About this point in time, probably in this
group, I had an explanation as to thetrade-offs. Unfortunately these days I
have no way to compile 3.96 which I really wish I could at least run for
usenet. Thanks in advance
Hart

unruh

unread,
Apr 23, 2013, 3:43:51 PM4/23/13
to
On 2013-04-23, unruh <un...@invalid.ca> wrote:
> On 2013-04-23, unruh <un...@invalid.ca> wrote:
>> On 2013-04-23, Howard Schwartz <howa...@gmail.com> wrote:
>>> unruh <un...@invalid.ca> wrote in news:nljdt.6984$X11....@newsfe30.iad:
>>
...

>> But that is a different question as to whether or not Linux can search
>> through a mail folder (eg INBOX) to find stuff. It can. But I do agree
>> that a search function in pine there was a bit more intelligent would
>> certainly be nice.
>
> Actually, I have just discovered that pine CAN do a search through the
> text of the message body, and of the full addresses, etc.
>
> Do a selection ";"
> select Text "T"
> select All "A"
> and it will search the whole body of the text message for the text to
> select. You can then do
> ";" again and select "N" (Narrow selection) and choose "T" and "F" to
> only mark those messages which are from a certain user as well, etc.
>
> The just look at those messages with an X in front of the displayed
> line.
> Not sure how you can jump from one marked text to the next.
>
> So you can use pine to search, via this somewhat convoluted path.
>>

Reading the help pages, I also discovered the Zoom command. Once you
have selected messages as above, you can have pine display only those
messages ( so you do not have to search through to find the X selection
mark) by hitting Z. This will then list only those selected messages. (Z
again undoes that display selection)
Amazing what you can find by reading the help pages!

So, while it does not do everything you want, pine does seem to do a
large part of what you want.



mechanic

unread,
Apr 24, 2013, 6:14:30 AM4/24/13
to
On Tue, 23 Apr 2013 19:43:51 GMT, unruh wrote:

> Amazing what you can find by reading the help pages!

sig alert!

Howard Schwartz

unread,
Apr 27, 2013, 6:28:10 PM4/27/13
to
unruh <un...@invalid.ca> wrote in news:guydt.6870$Ep5....@newsfe29.iad:

> Actually, I have just discovered that pine CAN do a search through the
> text of the message body, and of the full addresses, etc.
>
> Do a selection ";"
> select Text "T"
> select All "A"
> and it will search the whole body of the text message for the text to
> select. You can then do
> ";" again and select "N" (Narrow selection) and choose "T" and "F" to
> only mark those messages which are from a certain user as well, etc.
>

Pine could always do this incrimental, step by step search.
But as you say it is awkward and requires several search operations instead
of one.

unruh

unread,
Apr 27, 2013, 8:20:29 PM4/27/13
to
Again, oh dear. And it also does not read you mind and automatically
present you with exactly what you want when you open it. So it has gone
from "impossible" to "I have to carry out more than one step".

Do I ever feel foolish for having wasted my time telling you what you
already knew, but did not want to tell us you knew.


Michael Black

unread,
Apr 28, 2013, 10:45:51 AM4/28/13
to
It was a really good reminder. I used to use that sort of sequence in the
early days of using Pine, the specific things I can't remember, and have
gotten out of the habit. Pine does a lot more than I routinely use it
for, in part because I've settled in my ways after 17 years. It probably
is worth rereading the manual every so often, to be reminded of things
like this.

Michael

0 new messages