By the way, another thing that would be good is to put quotes around the
$MATCH argument to the lynx command, so that if the sender put spaces in
the argument it wouldn't cause lynx to see it as different arguments
(which could be used to circumvent the "http://" trick, mentioned below).
This will also help if the URL contains other shell-metacharacters.
Thus, I'd use
/usr/local/bin/lynx -dump "http://$MATCH")|$SENDMAIL -oi -t
as the last line in the recipe.
-- kurt
On Mon, 19 Jan 1998, Kurt Thams wrote:
Note that installing the recipe is going to make your files readable by
anyone, because lynx will be happy to accept the file:// protocol. (In
fact, it defaults to it), and since procmail is running as you... well,
you get the picture.
Try "GetFile: ~user/.login" for example.
You might revise the script to only allow URLs which begin with
"http://"
Alternately, maybe the syntax should be "GetPage: www.whatever.com" and
the script itself should always prepend an "http://" to the $MATCH.
-- kurt thams
-- thams(_at_)thams(_dot_)com
Timothy J Luoma wrote:
Author: Petrus Hyvonen
<93ph(_at_)ryp76(_dot_)ryp(_dot_)umu(_dot_)se>
Original-Date: Mon, 19 Jan 1998 17:17:57 +0100
Message-ID:
<3(_dot_)0(_dot_)5(_dot_)32(_dot_)19980119171757(_dot_)007cea70(_at_)ryp76(_dot_)ryp(_dot_)umu(_dot_)se>
Anyone who have any advice on this??
Neat idea. This works for me.
:0
* ^Subject:[ ]GetPage:()\/.*
* ! ^X-Loop: luomat(_at_)peak(_dot_)org
|(formail -rt -I"Precedence: junk" \
-I"Subject: Requested page: $MATCH" \
-I"X-Loop: luomat(_at_)peak(_dot_)org" ; \
/usr/local/bin/lynx -dump $MATCH)|$SENDMAIL -oi -t
Send an email with the subject:
GetPage: http://some.url.here/
And it comes back...
Neato!
Make sure you change the path to 'lynx' if needed.
TjL