Path: 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 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 ] <