On Sun, 25 Feb 1996, Dan Nielsen wrote:
I will be receiving messages with the body containing email addresses
(one per line). I want to use procmail to send out a text file email
message (like "$HOME/example.txt" for example) to each of the email
addresses in the body of the recieved message. Any suggestions?
sure. Be a _lot_ more careful than this: :)
Have procmail feed the body of the message to a perl script that will
mail each individual.
:0 b
*^(your criteria)
|perl Script
And the perl script look something like this:
while ($victim=<STDIN>) {
`elm -s 'some subject' <the.file $victim`;
}
In particular change the headers a little here and there. This is
closer to what I might do
:0
* ! ^FROM_DAEMON
* ! X-Loop: your-address
<conditions>
{
# first get the recipients
# just make sure that things are right by converting the newlines to
# spaces
:0 bc
Recipients=| tr '\012' ' '
:0
| (echo 'To: Lots Of People:;' ;\
echo 'From: ...' ;\
echo 'Subject: ...' ;\
echo 'X-Loop: ...' ;\
echo '' ; cat $file ) | $SENDMAIL -oi $Recipients
}
Soren