Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!samsung!ernie.viewlogic.com!kenc From: kenc@suntan.viewlogic.com (Kenstir) Newsgroups: comp.mail.sendmail Subject: Mail filters Keywords: filter Message-ID: <1991Mar15.195109.12234@viewlogic.com> Date: 15 Mar 91 19:51:09 GMT Sender: news@viewlogic.com (News Administrator) Organization: Viewlogic Systems, Inc., Marlboro, MA Lines: 35 Originator: kenc@madmax I'd like to set up a filter on my mail, and I'd like it to happen between the time sendmail gets its paws on the text and the time it puts the file in /usr/spool/mail. I *have* been successful in doing this via two methods, neither of which is completely satisfactory: 1. Set up the YP alias: kenc:"|/u/kenc/mail-filter kenc@host" Set up /u/kenc/mail-filter: awk -f foo.awk | /usr/lib/sendmail -n $1 PROBLEMS: The mail-filter gets run on the machine the mail from which it is sent and also the machine *to* which it is sent. This also creates extra sysadmin work setting up the aliases. 2. Set up a .forward: "|/u/kenc/mail-filter2 kenc" And then in /u/kenc/mail-filter2: awk -f foo.awk >> /usr/spool/mail/kenc PROBLEMS: I'm not doing any file locking and I'm sure eventually I would run into race conditions. I would greatly appreciate any advice! -- Kenneth H. Cox Viewlogic Systems, Inc. kenc@viewlogic.com ..!harvard!cg-atla!viewlog!kenc