Article View: comp.mail.mh
Article #1887Re: Message sorting into folders when doing inc
From: gregg.g.wonderly
Date: Sun, 21 May 1989 21:09
Date: Sun, 21 May 1989 21:09
72 lines
3213 bytes
3213 bytes
From article <8905191059.AA14214@garm>, by he@idt.unit.no:
> This is a beginners question on using MH. I have read the documentation,
> but have not found what I was looking for. I have also read the
> comp.mail.mh newsgroup for a while, with same result (unfortunately, I am
> currently unable to post to that newsgroup).
>
> What I am looking for, is a way to tell 'inc' to sort individual messages
> into their respective folders based on criteria a'la pick, instead of
> lumping them all into +inbox. I have found a couple of alternative ways to
> do (almost) what I want, but not quite:
I wrote a replacement for slocal which I call rcvmail. It reads the file
~/.mh_delivery which contains lines of the form
pick args : accept/reject : shell command
When mail is passed to it on stdin, it files the mail into the folder,
+newmail (by default) using rcvstore(1). It then runs commands of
the form
pick all +newmail 'pick args'
on a pipe. When pick returns matches, it runs 'shell command' with
the messages (one at a time). If accept is specified, the message
is accepted as delivered and rcvmail exits. If reject is specified
the it continues through the actions until one matches, or EOF is reached.
At EOF, the message is filed into +inbox with the Unseen-sequence set.
I have modified rcvstore(1) so that it accepts a -alert flag which causes
it to send scan lines formatted by, scan.new, to the terminal, or to the
fifo ~/.maildrop if it exists (this allows me to run cat off of the fifo to
a specially allocated window on my 630). A new component (pseudo I suppose),
%{folder}, was added to allow the scan line to look like
inbox 8 14:24 foobar@goof.us.dis [ Just some stuff ] <<Gregg, I notic
(scansbr.c knows about a global char * which is set to the folder name
by rcvstore(1). Other MH programs could do this too, but I haven't
though of a reason for them to yet) This is really great because as I
get new mail that is squirreled away into some folder, I know when I
get it, where to find it.
Now for the biggy. How do I find everything when I log in and have new
mail? Easy, I modified m_update(), and added some routines of my own,
so that MH maintains lines in ~/Mail/context of the form (unread is my
Unseen-sequence)
unread: inbox mh trains planes automobiles
A new mh program, seq(1), will return either the sequences that a folder
contains, or the folders containing a sequence. So, I have a simple
shell script which pushes the folder list onto the Folder-Stack, and
does
echo "New mail in '`folder -list`'"
I can then just do
while there are folders with unread mail
do
scan unread
show them
show them
show them
folder -pop
done
--
-----
gregg.g.wonderly@att.com (AT&T bell laboratories)
Technical Details
Message-ID:
<908@cbnewsc.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!att!cbnewsc!greggReferences:
<8905191059.AA14214@garm>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!att!cbnewsc!gregg From: gregg@cbnewsc.ATT.COM (gregg.g.wonderly) Newsgroups: comp.mail.mh Subject: Re: Message sorting into folders when doing inc Message-ID: <908@cbnewsc.ATT.COM> Date: 21 May 89 21:09:18 GMT References: <8905191059.AA14214@garm> Organization: AT&T Bell Laboratories Lines: 72