Path: utzoo!attcan!uunet!umich!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!theory.tn.cornell.edu!jch From: jch@risci.tn.cornell.edu (Jeffrey C Honig) Newsgroups: comp.mail.mh Subject: Re: xbiff with automagic-incing Message-ID: Date: 28 Oct 90 03:47:27 GMT References: <9010261417.AA21847@rodan.acs.syr.edu> <9010272052.AA14483@moria.eng.umd.edu> Sender: news@batcomputer.tn.cornell.edu Organization: Cornell Theory Center; Cornell University; Ithaca, NY USA Lines: 45 In-Reply-To: ziegast@ENG.UMD.EDU's message of 27 Oct 90 20:52:04 GMT Nntp-Posting-Host: risci.tn.cornell.edu I just thought I would throw in my 2 cents worth. I use a wrapper around slocal, primarily because sendmail does not grok the return codes issued by slocal (someday I'll get around to fixing that). A side effect is that I can then specify the -verbose switch to slocal and get a log of mail received into a file. I use a sh/awk script to scan this log and show me which folders mail was stored in. This turns out to work very nicely with xbiff, I just point it at this log file: xbiff*file: Mail/slocal.log I'm including my wrapper script. Note that it uses a temporaray file to reduce the chance of multiple invocations from jumbling the file. I invoke it with a .forward of: "| cd /mu/jch; bin/slocal -user jch -verbose" I've written a program to replace the mini awk script to allow scripts to read .mh_profile, but haven't updated this script yet. It is called mhparam and prints to stdout the value of any .mh_profile entries you specify on the command line. I'll submit it to the MH maintainers eventually, send me e-mail if you can't wait. Jeff #!/bin/sh file=/tmp/`basename ${0}`.$$ status=0 HOME=${PWD=`pwd`} export HOME profile=${PWD-`pwd`}/.mh_profile slocal=`mhpath +`/`/bin/awk "\\\$1 == \"Slocal-Log:\" { print \\\$2 }" ${profile}` echo "`date`: ${0} ${*}" > ${file} 2>&1 /usr/local/lib/mh/slocal ${*} >> ${file} 2>&1 || status=75 if [ -n ${slocal-""} ]; then cat ${file} >> ${slocal} fi rm ${file} exit $status