home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / mail / elm / 2157 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  2.5 KB

  1. Path: sparky!uunet!wupost!usc!sdd.hp.com!think.com!paperboy.osf.org!hsdndev!news.cs.umb.edu!rouilj
  2. From: rouilj@cs.umb.edu (John P. Rouillard)
  3. Newsgroups: comp.mail.elm
  4. Subject: Re: Enhancement request for ELM filter command
  5. Message-ID: <ROUILJ.92Aug18190708@ra.cs.umb.edu>
  6. Date: 19 Aug 92 00:07:08 GMT
  7. References: <cos.712183928@chaos.cs.brandeis.edu> <1992Jul26.231451.9856@DSI.COM>
  8.     <Bs3CqG.F66@newcastle.ac.uk> <Bs4LsE.8oG@well.sf.ca.us>
  9.     <1992Aug4.161853.26883@news.uit.no>
  10. Sender: news@cs.umb.edu (USENET News System)
  11. Organization: University of Massachusetts at Boston
  12. Lines: 55
  13. In-Reply-To: bjoerns@stud.cs.uit.no's message of 4 Aug 92 16: 18:53 GMT
  14. Nntp-Posting-Host: ra.cs.umb.edu
  15.  
  16.  
  17. I use deliver with a set of perl routies that allow a filter like
  18. syntax. As a matter of fact, I patterned the command set on the filter
  19. documentation.
  20.  
  21. My .deliver file looks like:
  22.  
  23.   < code to load the library >
  24.   # Set my login name
  25.   $ME="rouilj";
  26.   # Set the name of the log file. Setting this also enables logging.
  27.   $log_file = "~rouilj/.deliver.log";
  28.   # Establish a sig for automatic acks.
  29.   $closure="\n\n John's secretary 8-)\n";
  30.  
  31.   # Forward my mail to the main mail hub
  32.   # If this machine is not ra, then mail it to ra.
  33.     if ( `hostname` !~ "ra.cs.umb.edu") 
  34.         {
  35.            print "DROP" unless &bounce("rouilj@ra.cs.umb.edu");
  36.            exit;
  37.         }
  38.  
  39.   &unreceived("/usr/spool/mail/$ME"); # check to see if I have
  40.                       # received this message already
  41.   ©(":Mail/Boing") if  # put a copy in the file ~/Mail/Boing
  42.             $Subject =~ /Returned mail:/i && $From =~ /Mailer-Daemon/i ;
  43.   ©(":Mail/DSR") if $Subject =~ /^DSCR / && 
  44.           &unreceived("Mail/DSR");
  45.   &deliver(":Mail/NTP") if $Subject =~ /NTP stats/;
  46.   &deliver(":Mail/ntpdate") if $Header{'x-cron-cmd'} =~ /ntpdate/;
  47.   &deliver(":Mail/amq") if $Header{'x-cron-cmd'} =~ /amq/;
  48.   &ack() if $From =~ /boss@cqr.ds1.gov/i ;
  49.  
  50.   [...]
  51.  
  52. The log file looks like:
  53.  
  54.   Mail from root@lwm.ds1.umlb.edu about cron for news@lwm said this
  55.      line 50 default rouilj
  56.   Mail from betsus about [mark@kronum.com: Re: news feed]
  57.      line 50 default rouilj
  58.   Mail from root about NTP stats
  59.      line 34 deliver :Mail/NTP
  60.   Mail from root about mak: No files have changed
  61.      line 42 deleted done
  62.   Mail from root@vm.umcb.edu about fooble
  63.      line 42 deleted done
  64.  
  65. If you want I can send a copy of the perl library routines out, or
  66. post them. The documentation is basically included in the library
  67. file, but a sample .deliver file should suffice for all but power
  68. users, then they will need to know a bit of perl anyway.
  69.  
  70. -- John
  71.