On 23 Mar 1999, in message <000301be7532$dbbc06e0$[EMAIL PROTECTED]>
"Denis Voitenko" <[EMAIL PROTECTED]> wrote:
| I am trying to configure procmail to respond to an email that contains a
| list of URLs with their content. For example, if someone send a message to
|
| [EMAIL PROTECTED] that contains in the body the something like this:
|
| http://www.urlnumberone.com
| http://www.urlnumbertwo.com
| http://www.urlnumberthree.com
|
| it would parse the whole message and reply with three messages that contain
| contents of these pages (thru lynx) with the URL in the subject. Does anyone
| have a ready to go example or I'd have to dig deep into the manual?
Have procmail pipe the message (with headers) to a script of your own devising.
Suck the headers off the script to get the reply address (remembering to
use Reply-To: instead of From: if present).
For the remaining lines, read each one:
while read url
do ( echo "To: $replyaddr"
echo "From: [EMAIL PROTECTED]"
echo "Subject: get $url"
wget -q -s -O - "$url" | sed '1s/^/X-HTTP-Response: /'
) | /usr/lib/sendmail -oi -t
done
Note how we don't leave a blank link after the Subject:, because this
was we can cleverly include the HTTP headers, which is kinda neat since
HTTP responses are RFC822 complaint (because they're MIME-complaint).
We do have to fake the response code up into a header line, hence the sed.
I'd expect such a service to be easy to abuse. I hope you don't have to pay
for your bandwidth!
--
Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/
"What do you want to reinstall today?" - Bob O`Bob <[EMAIL PROTECTED]>