Subject: Creating new mail

From: "HHELLER" <[email-masked]>
Date: Tue, 10 Jan 95 14:15:41 est

Hi, 
     
     I receive an electronic magazine which lets me request articles 
     based on a reference number in the Table of Contents.  Since I 
     like to get all the articles, I wrote a program that parses the 
     Table of Contents and creates a file with the reference numbers.  
     I then cut and paste these numbers into the subject line of a 
     mail message and send it to them.
     
     I have figured out how to use ProcMail to run the above program 
     when I receive the Table of Contents, but I am not sure how to 
     create the new mail messages to retrieve the articles 
     automatically.  The program I wrote takes the Table of Contents 
     as input and outputs the reference numbers (10 on a line) to 
     stdout.  It also saves the Table of Contents to a file name 
     Year_Month_Day (It gets the month & day from the subject line), 
     and saves the tokens to a file named tokens.
     
     Heres what I have so far:
     
     :0
     *^From:.*Originator
     *^Subject: Table of Contents: *
     {
       MONTH=`formail -x Subject: | awk '{print $5}'`
       DAY=`formail -x Subject: | awk '{print $6}'`
       YEAR=`date +%y`
       :0b
       | TOC_Parse $HOME/Mail/${YEAR}_${MONTH}_${DAY} 
     $HOME/Mail/tokens
     }

     I would like to pipe the output of TOC_Parse (which is the 
     reference numbers) to formail (????) to create the messages and 
     then pipe that to $SENDMAIL.
     
     Whenever I tried to pipe the output of TOC_Parse to something, 
     procmail wouldn't evaluat the environment variables on that line.
     
     If anyone can help me, I'd really appreciate it.  If I didn't 
     explain something well enough, send me a question.
     
     Thanks,
     
     Howard Heller
     [email-masked]

---

From: Adam Shostack <[email-masked]>
Date: Tue, 10 Jan 1995 15:12:33 -0500 (EST)

You want to give the article numbers to a mail program.  It would be
easy if we had them all in one variable, $ARTICLES.

:0 A
| Mail -s $ARTICLES [email-masked]

You could probably wrap this in a loop, doing something with a 'for x
in $articles' if theres a limit to how many articles you get per line.

Adam

|      I have figured out how to use ProcMail to run the above program 
|      when I receive the Table of Contents, but I am not sure how to 
|      create the new mail messages to retrieve the articles 
|      automatically.  The program I wrote takes the Table of Contents 
|      as input and outputs the reference numbers (10 on a line) to 
|      stdout.  It also saves the Table of Contents to a file name 
|      Year_Month_Day (It gets the month & day from the subject line), 
|      and saves the tokens to a file named tokens.

-- 
"It is seldom that liberty of any kind is lost all at once."
						       -Hume