Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!RODAN.ACS.SYR.EDU!jdpeek From: jdpeek@RODAN.ACS.SYR.EDU (Jerry Peek) Newsgroups: comp.mail.mh Subject: Re: Bouncing mail... Message-ID: <9003022209.AA14923@rodan.acs.syr.edu> Date: 2 Mar 90 23:09:28 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 29 I'll just pick one of Scott's questions: > 3) Is there any better way of "auto-filing" the messages? I've looked > .maildelivery stuff, but it didn't seem to be flexible enough for > I wanted to do. You might look into scan format strings and form files. They're a nice way to pull out exactly the header information your shell script needs. (I used to use "sed" and "awk" to parse "scan" output--what a pain!) With this, your shell/awk/whatever auto-filer can probably get to the real job more efficiently. Here's a quick example of a format string that prints the message number in a field of width 4, then a space. After that, it prints the "Sender:" field, if the message has one--otherwise, it prints the "From:" field. $ scan -format "%4(msg) %<{sender}%{sender}%|%{from}%>" last:5 1146 "Jerry Peek" 1147 Rick Amory 1148 "Wilbur, Orville" 1151 EAMYLON@SUNSET.CAS.SYR.EDU (Edwin A. Mylon) 1152 mh-users-request@ICS.UCI.EDU There's a lot more to this. For instance, the %(friendly) escape gives just addresses without the users' "real" names. The mh-format(5) manual page will get you going on this (if you aren't, already). --Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY jdpeek@rodan.acs.syr.edu, JDPEEK@SUNRISE.BITNET +1 315 443-3995