home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!usc!sdd.hp.com!think.com!paperboy.osf.org!hsdndev!news.cs.umb.edu!rouilj
- From: rouilj@cs.umb.edu (John P. Rouillard)
- Newsgroups: comp.mail.elm
- Subject: Re: Enhancement request for ELM filter command
- Message-ID: <ROUILJ.92Aug18190708@ra.cs.umb.edu>
- Date: 19 Aug 92 00:07:08 GMT
- References: <cos.712183928@chaos.cs.brandeis.edu> <1992Jul26.231451.9856@DSI.COM>
- <Bs3CqG.F66@newcastle.ac.uk> <Bs4LsE.8oG@well.sf.ca.us>
- <1992Aug4.161853.26883@news.uit.no>
- Sender: news@cs.umb.edu (USENET News System)
- Organization: University of Massachusetts at Boston
- Lines: 55
- In-Reply-To: bjoerns@stud.cs.uit.no's message of 4 Aug 92 16: 18:53 GMT
- Nntp-Posting-Host: ra.cs.umb.edu
-
-
- I use deliver with a set of perl routies that allow a filter like
- syntax. As a matter of fact, I patterned the command set on the filter
- documentation.
-
- My .deliver file looks like:
-
- < code to load the library >
- # Set my login name
- $ME="rouilj";
- # Set the name of the log file. Setting this also enables logging.
- $log_file = "~rouilj/.deliver.log";
- # Establish a sig for automatic acks.
- $closure="\n\n John's secretary 8-)\n";
-
- # Forward my mail to the main mail hub
- # If this machine is not ra, then mail it to ra.
- if ( `hostname` !~ "ra.cs.umb.edu")
- {
- print "DROP" unless &bounce("rouilj@ra.cs.umb.edu");
- exit;
- }
-
- &unreceived("/usr/spool/mail/$ME"); # check to see if I have
- # received this message already
- ©(":Mail/Boing") if # put a copy in the file ~/Mail/Boing
- $Subject =~ /Returned mail:/i && $From =~ /Mailer-Daemon/i ;
- ©(":Mail/DSR") if $Subject =~ /^DSCR / &&
- &unreceived("Mail/DSR");
- &deliver(":Mail/NTP") if $Subject =~ /NTP stats/;
- &deliver(":Mail/ntpdate") if $Header{'x-cron-cmd'} =~ /ntpdate/;
- &deliver(":Mail/amq") if $Header{'x-cron-cmd'} =~ /amq/;
- &ack() if $From =~ /boss@cqr.ds1.gov/i ;
-
- [...]
-
- The log file looks like:
-
- Mail from root@lwm.ds1.umlb.edu about cron for news@lwm said this
- line 50 default rouilj
- Mail from betsus about [mark@kronum.com: Re: news feed]
- line 50 default rouilj
- Mail from root about NTP stats
- line 34 deliver :Mail/NTP
- Mail from root about mak: No files have changed
- line 42 deleted done
- Mail from root@vm.umcb.edu about fooble
- line 42 deleted done
-
- If you want I can send a copy of the perl library routines out, or
- post them. The documentation is basically included in the library
- file, but a sample .deliver file should suffice for all but power
- users, then they will need to know a bit of perl anyway.
-
- -- John
-